refactor: use database transaction RPC for local coding sync#1269
Merged
Priyanshu-byte-coder merged 1 commit intoMay 28, 2026
Merged
Conversation
|
@bhavyanjain3004 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
Priyanshu-byte-coder
added a commit
that referenced
this pull request
May 28, 2026
Co-authored-by: bhavyanjain3004 <bhavyanjain3004@users.noreply.github.com>
cf3207f
into
Priyanshu-byte-coder:main
11 checks passed
|
🎉 Merged! Thanks for contributing to DevTrack. If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers. Keep an eye on open issues for your next contribution! |
KrutagyaKaneria
pushed a commit
to KrutagyaKaneria/devtrack
that referenced
this pull request
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #816. Refactors the local coding sessions sync endpoint to use a database-level transaction function (
batch_upsert_sessionsRPC). This ensures atomic writes and prevents PostgreSQL cardinality errors when duplicate date entries are present in a single batch.Changes
batch_upsert_sessions(sessions jsonb)function and updatedschema.sql..upsert()withsupabaseAdmin.rpc("batch_upsert_sessions")insrc/app/api/local-coding/sync/route.ts.test/local-coding-sync.test.tsto verify authentication, validations, database limits, and RPC success/error handling.How to Verify
1. Running the Automated Tests
Run the newly added unit tests specifically written for this endpoint:
npm test test/local-coding-sync.test.ts