Skip to content

feat: sort snapshot tags alphabetically in listSnapshots() - #21

Open
vivekyadav-3 wants to merge 2 commits into
tanmayjoddar:mainfrom
vivekyadav-3:feat/sort-list-output-alphabetically
Open

feat: sort snapshot tags alphabetically in listSnapshots()#21
vivekyadav-3 wants to merge 2 commits into
tanmayjoddar:mainfrom
vivekyadav-3:feat/sort-list-output-alphabetically

Conversation

@vivekyadav-3

Copy link
Copy Markdown

Summary

Closes #6

listSnapshots() was returning snapshot file tags in whatever order
the OS filesystem provided — which is non-deterministic and differs
between Linux, macOS, and Windows.

Changes

  • src/storage/snapshotStore.js: Added .sort() to the end of the
    listSnapshots() return chain

Before / After

Before After
v2.0, main, beta, v1.0 (random OS order) beta, main, v1.0, v2.0 (stable A→Z)

Notes

  • No behaviour changes beyond ordering
  • .sort() uses locale-independent lexicographic ordering by default
  • Existing tags like v1.0.13 continue to work unchanged
  • npm test passes ✅

Copilot AI review requested due to automatic review settings May 20, 2026 04:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR makes listSnapshots() return snapshot tags in a deterministic order by sorting them alphabetically before returning, ensuring stable output across OS/filesystem differences.

Changes:

  • Sorts the array of snapshot tags A→Z in listSnapshots() by adding .sort() to the return chain.

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

Comment thread src/storage/snapshotStore.js Outdated
.readdirSync(SNAP_DIR)
.filter((f) => f.endsWith(".json"))
.map((f) => f.replace(".json", ""));
.map((f) => f.replace(".json", ""))
@vivekyadav-3

Copy link
Copy Markdown
Author

Hi @tanmayjoddar,
I have submitted this pull request to resolve the corresponding issue. The changes are fully tested, have no merge conflicts, and are ready for review.
Could you please take a look and merge this under GSSoC '26 when you get a chance? Thank you

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.

enhancement: sort pidrift list output alphabetically

3 participants