jazz icon indicating copy to clipboard operation
jazz copied to clipboard

Implement loadOrCreateUnique

Open joeinnes opened this issue 2 months ago • 5 comments

Description

Implements a getOrCreateUnique to complement upsertUnique

Manual testing instructions

N/A

Tests

  • [x] 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
  • [x] I've generated a changeset, if a version bump is required
  • [x] I've updated the jsDoc comments to the public APIs I've modified, or added them when missing

joeinnes avatar Oct 02 '25 10:10 joeinnes

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
design-system Ready Ready Preview Comment Oct 20, 2025 2:00pm
gcmp-homepage Ready Ready Preview Comment Oct 20, 2025 2:00pm
passkey-demo Ready Ready Preview Comment Oct 20, 2025 2:00pm
quint-ui Ready Ready Preview Comment Oct 20, 2025 2:00pm
23 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
clerk-demo Ignored Ignored Preview Oct 20, 2025 2:00pm
file-upload-demo Ignored Ignored Preview Oct 20, 2025 2:00pm
form-demo Ignored Ignored Preview Oct 20, 2025 2:00pm
image-upload-demo Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-chat Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-chat-1 Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-chat-2 Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-filestream Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-homepage Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-image-upload Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-inspector Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-multi-cursors Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-organization Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-paper-scissors Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-richtext Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-richtext-prosekit Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-richtext-tiptap Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-todo Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-vector-search Ignored Ignored Preview Oct 20, 2025 2:00pm
jazz-version-history Ignored Ignored Preview Oct 20, 2025 2:00pm
music-demo Ignored Ignored Preview Oct 20, 2025 2:00pm
passphrase-auth-demo Ignored Ignored Preview Oct 20, 2025 2:00pm
reactions-demo Ignored Ignored Preview Oct 20, 2025 2:00pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

vercel[bot] avatar Oct 02 '25 10:10 vercel[bot]

I don't really understand why the E2E tests are failing, unit tests are good.

joeinnes avatar Oct 02 '25 10:10 joeinnes

Updated based on context in https://github.com/garden-co/jazz/issues/2994#issuecomment-3416485076

  • name changed
  • added deduplication map (similar to the MessageQueue processing set, but kept at module level like coValueCache to avoid exposing to subclasses)
  • adjust methods to check for in-flight operations
  • add tests

Note: I didn't fix upsertUnique, but it has the same race condition concerns. I can apply the same fix if the approach is good (if so, I guess we should use the same map, right?)

joeinnes avatar Oct 20 '25 13:10 joeinnes

✅ All jobs passed

Summary: 6 successful workflows

Last updated: 2025-10-20 14:00:56 UTC

blacksmith-sh[bot] avatar Oct 20 '25 13:10 blacksmith-sh[bot]

Let's pause this PR until we find a final pattern for unique

gdorsi avatar Oct 29 '25 11:10 gdorsi