Skip to content

Saved view ids can collide in recommendation export filenames #16

Description

@feng-shiplight

sanitizeFileSegment in packages/core/src/recommendation-export/index.ts is not injective:

"my view" -> "my-view"
"my-view" -> "my-view"   <-- same file

Two saved views with those ids write the same export under
.quality/generated/recommendations/, and one silently overwrites the other.

Pre-existing: the views parser has never enforced an id shape, so both ids have
always been accepted. Surfaced during review of #15, which removed the unused
schema pattern that had documented the constraint without enforcing it.

A fix was tried in #15 and reverted: appending a digest when sanitizing is lossy
makes the segment unique, but renames the export file for every id that needs
sanitizing, breaking anything that addresses an existing export by name. That
trade needs its own change and a migration note.

Referenced from the comment on sanitizeFileSegment.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions