Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 30d858b The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 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 |
…ant inbox network calls Made-with: Cursor
b171fba to
c4cbcb6
Compare
* Add batch size limit of 50 to open requests Introduces OPEN_BATCH_MAX_SIZE = 50 to cap the number of message IDs sent in a single batchOpen GraphQL mutation. When more than 50 messages are queued, flushBatchOpen splits them into chunks and sends them as parallel requests via Promise.all. This prevents oversized GraphQL payloads from hitting server-side limits when many messages become visible at once (e.g. rapid scrolling). Co-authored-by: Mike Miller <mike@mikemiller.design> * Add boundary test for batch size just over the limit (51) Adds a test verifying 51 messages produce 2 chunks (50 + 1), and an explicit assertion that no single batchOpen call ever exceeds 50 IDs. Co-authored-by: Mike Miller <mike@mikemiller.design> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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
InboxClient.batchOpen(messageIds)that combines multipleopened()mutations into a single aliased GraphQL request. Replace the per-message server call inCourierInboxDatastore.openMessagewith a debounced batch queue (100ms window) — optimistic UI updates remain immediate. No existing public APIs change.feedsas an HTML attribute on<courier-inbox>and<courier-inbox-popup-menu>so the web component has the correct feeds beforeinitializeInboxDataruns. This removes the redundantsetFeeds()→refresh()cycle from the React wrapper'suseEffect, cutting inbox requests on mount from 4 to 2 per component.Changes
Batch open (
courier-js,courier-ui-inbox)InboxClient.batchOpen(messageIds)method — single aliased GraphQL mutationCourierInboxDatastore.openMessagenow queues opens and flushes via a 100ms debounced batchFeeds as attribute (
courier-ui-inbox,courier-react-components)CourierInbox: addedfeedstoobservedAttributes;attributeChangedCallbackstores feeds before init or callssetFeedsafter initCourierInboxPopupMenu: same treatment — stores feeds from attribute before creating the innerCourierInbox, passes them before DOM appendCourierInboxComponent(React): passesfeedsas a memoized JSON attribute, removedsetFeedsuseEffectCourierInboxPopupMenuComponent(React): same changesTest plan
batchOpen([id])batchOpencallbatchOpencallsInboxClient.batchOpenaddedsetFeeds→refreshcorrectly