Skip to content

fix: fixes InvalidSignature errors that could happen during streaming#2621

Merged
gdorsi merged 2 commits intofix/remove-storage-peersfrom
fix/invalid-signature
Jul 8, 2025
Merged

fix: fixes InvalidSignature errors that could happen during streaming#2621
gdorsi merged 2 commits intofix/remove-storage-peersfrom
fix/invalid-signature

Conversation

@gdorsi
Copy link
Collaborator

@gdorsi gdorsi commented Jul 8, 2025

Description

Found that when stale content is reiceved on storage we still update the lastSignature, leading to overriding the valid lastSignature with one that is referred to an old transaction.

Manual testing instructions

Reproduced the InvalidSignature bug using tests/stress-test app, restarting the sync server while having a page with 10k tasks open.

In practice, we may still send non-required content when both the client and the sync-server are loading a coValue in streaming.

This can cause one of the two nodes to send some content blocks, which leads to updating the lastSignature with one of the chunk signatures.

In production this bug can be reproduced in a similar way.

Tests

  • Tests have been added and/or updated
  • Tests have not been updated, because:
  • I need help with writing tests

Checklist

  • I've updated the part of the docs that are affected the PR changes
  • I've generated a changeset, if a version bump is required
  • I've updated the jsDoc comments to the public APIs I've modified, or added them when missing

@vercel
Copy link

vercel bot commented Jul 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
design-system ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
file-upload-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
form-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
gcmp-homepage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
image-upload-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-chat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-chat-1 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-chat-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-filestream ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-image-upload ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-inspector ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-multi-cursors ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-organization ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-paper-scissors ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-richtext ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-richtext-prosekit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-richtext-tiptap ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-todo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
jazz-version-history ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
music-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
passkey-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
passphrase-auth-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
reactions-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 3:39pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
jazz-homepage ⬜️ Ignored (Inspect) Visit Preview Jul 8, 2025 3:39pm

sessionEntry.newTransactions.push(tx.tx);
}

sessionEntry.lastSignature = signature;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a small refactoring to make the code cleaner

@gdorsi gdorsi force-pushed the fix/invalid-signature branch from e50fea8 to 375825c Compare July 8, 2025 14:50
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.

2 participants