Enhanced logging for parameter query results#520
Merged
Sleepful merged 2 commits intopowersync-ja:mainfrom Feb 23, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 04484d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Author
|
I found it convenient to look at the diff between the two branches and scrolling to the test file Edit: Oh um nevermind, this github diff is too noisy, here is the actual git diff that I wanted to show (keeps same test file with rebase modifications): diff --git a/packages/service-core/test/src/sync/BucketChecksumState.test.ts b/packages/service-core/test/src/sync/BucketChecksumState.test.ts
index 8dd177c61f..f706bc018a 100644
--- a/packages/service-core/test/src/sync/BucketChecksumState.test.ts
+++ b/packages/service-core/test/src/sync/BucketChecksumState.test.ts
@@ -849,7 +849,7 @@
const state = new BucketChecksumState({
syncContext,
- tokenPayload: { sub: 'u1' },
+ tokenPayload: new JwtPayload({ sub: 'u1' }),
syncRequest,
syncRules: SYNC_RULES_DYNAMIC,
bucketStorage: storage,
@@ -884,7 +884,7 @@
data: []
`,
{ defaultSchema: 'public' }
- ).hydrate({ hydrationState: versionedHydrationState(4) });
+ ).config.hydrate({ hydrationState: versionedHydrationState(4) });
const storage = new MockBucketChecksumStateStorage();
@@ -908,7 +908,7 @@
const state = new BucketChecksumState({
syncContext: smallContext,
- tokenPayload: { sub: 'u1' },
+ tokenPayload: new JwtPayload({ sub: 'u1' }),
syncRequest,
syncRules: SYNC_RULES_MULTI,
bucketStorage: storage,
@@ -971,7 +971,7 @@
yamlDefinitions += ` data: []\n`;
}
- const SYNC_RULES_MANY = SqlSyncRules.fromYaml(yamlDefinitions, { defaultSchema: 'public' }).hydrate({
+ const SYNC_RULES_MANY = SqlSyncRules.fromYaml(yamlDefinitions, { defaultSchema: 'public' }).config.hydrate({
hydrationState: versionedHydrationState(5)
});
@@ -995,7 +995,7 @@
const state = new BucketChecksumState({
syncContext: smallContext,
- tokenPayload: { sub: 'u1' },
+ tokenPayload: new JwtPayload({ sub: 'u1' }),
syncRequest,
syncRules: SYNC_RULES_MANY,
bucketStorage: storage,
@@ -1020,7 +1020,7 @@
// Verify only top 10 are shown
const errorMessage = errorMessages[0];
- expect(errorMessage).toContain('... and 5 more');
+ expect(errorMessage).toContain('... and 5 more results from 5 definitions');
// Count how many definitions are listed (should be exactly 10)
const defMatches = errorMessage.match(/def\d+:/g); |
- Extract checkpoint log message to helper function - Extract error message generation to helper function - Log remaining result count (not definition count) when truncating top 10 - Fix test types to match current API (JwtPayload, config.hydrate)
c4352c4 to
04484d1
Compare
Contributor
Author
|
Rebased with main |
rkistner
approved these changes
Feb 23, 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
Adds detailed logging for parameter query results to improve debugging when the configured limit is exceeded. Users currently only see a generic
PSYNC_S2305error with no breakdown of which sync stream definitions are contributing.Based on #462 by @hamzzy, rebased onto current main with review feedback addressed.
Changes
Original work (hamzzy)
param_resultscount to checkpoint log messages and structured log dataPSYNC_S2305error messages (top 10, sorted by count)Review fixes
Addresses feedback from @rkistner on #462:
computeTotalParamResults()+logCheckpoint()helpersformatParameterQueryBreakdown()helper"... and N more results from M definitions"JwtPayloadconstructor,.config.hydrate())Packages affected (patch)
@powersync/service-core