Repository navigation
chore(coderd/x/chatd): clean up the message part buffer comments and implementation - #26508
Conversation
80de26c to
042b512
Compare
There was a problem hiding this comment.
This is a focused cleanup of a very new package, and the documentation it adds is mostly the right kind: the out/notifyCh/stopCh channel comments, the AddPart sequence-number rationale, the GetParts detached-slice note, and the CloseEpisode create-on-close note all match the code and answer a real "why". The markCreated/close/notifySubscribers/getEpisodeLocked extractions are behavior-preserving (traced by Pariston and Mafu-san, and Komugi confirmed the package passes go test -race -count=5), and Bisky verified the existing suite already covers every branch of the new helpers.
The panel reviewed the whole package, not just the diff, per the review focus. Findings: 3 P2, 1 P3, 4 Nit, 3 Note. None block on correctness today; all three P2s are documentation-vs-code mismatches in a PR whose stated deliverable is accurate documentation, so they matter more here than the severity label suggests. Since this is the documentation pass, it is also the moment to reconcile the dead SubscriberChannelSize option (CRF-1): the new "out is unbuffered" comment makes that option's continued existence a contradiction rather than a latent knob.
On the #26109 feedback this PR set out to address: the getEpisode helper (r3379915812) and the doc expansion (r3379988015) landed; markCreated (r3380010948) landed but the extraction is half-done (CRF-5, AddPart still inlines the notify loop); the channel-buffering documentation (r3380029684) landed and is accurate for notifyCh/stopCh/done, but it also exposed the dead SubscriberChannelSize option it does not reconcile.
Process note: the new package doc and two method comments describe the removed createdCh early-subscriber wakeup design rather than the current notify-driven path. A documentation pass on a new package is the right time to re-check every comment that mentions early-subscriber timing against the current code, not just the three flagged here.
From Hisoka, who pulled the thread the PR set out to document: "A worthy package. It hides one real face behind a documented one, and the documentation pass is what exposed it."
🤖 This review was automatically generated with Coder Agents.
042b512 to
903f4be
Compare
Address deferred review feedback for
messagepartbufferby documenting its episode lifecycle, extracting the repeated episode lookup and finalization helpers, and documenting subscriber channel buffering decisions.Addresses these PR #26109 comments: