Skip to content

fix(repository): sort in-memory artifact and representation results to match Postgres adapter ordering#9

Merged
ryanjosebrosas merged 1 commit intoa7u-pr-basefrom
copilot/sub-pr-7
Mar 25, 2026
Merged

fix(repository): sort in-memory artifact and representation results to match Postgres adapter ordering#9
ryanjosebrosas merged 1 commit intoa7u-pr-basefrom
copilot/sub-pr-7

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 25, 2026

The in-memory createInMemoryRelationalWorkspaceRepository returned getPersistedArtifacts and getPersistedRepresentations in arbitrary Map insertion order, while the Postgres adapter orders by artifact_id / representation_id. This inconsistency made behavior backend-dependent and tests potentially order-sensitive.

Changes

  • src/subsystems/supabase/repository.ts — Added .sort() on both getPersistedArtifacts and getPersistedRepresentations returns, ordering by artifactId / representationId via localeCompare, aligning with the Postgres adapter's ORDER BY clause.
// before
return Array.from(state.artifacts.values()).filter(
  (record) => record.workspaceId === workspaceId && record.sourceId === sourceId,
);

// after
return Array.from(state.artifacts.values())
  .filter((record) => record.workspaceId === workspaceId && record.sourceId === sourceId)
  .sort((a, b) => a.artifactId.localeCompare(b.artifactId));

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI mentioned this pull request Mar 25, 2026
@ryanjosebrosas ryanjosebrosas marked this pull request as ready for review March 25, 2026 23:37
Copilot AI review requested due to automatic review settings March 25, 2026 23:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI changed the title [WIP] Fix issue with A7u PR base fix(repository): sort in-memory artifact and representation results to match Postgres adapter ordering Mar 25, 2026
Copilot AI requested a review from ryanjosebrosas March 25, 2026 23:37
@ryanjosebrosas ryanjosebrosas merged commit 781916d into a7u-pr-base Mar 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants