You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A Pulse Link Carries Its Destination, and One Table Delivers It - #654
Stage 1 of landing #615 in pieces on top of 0.5.0 (#644). This one is the foundation the Huddle, Clock and timesheet destinations will build on, and it changes nothing a person sees.
pulsevault.reserve now takes { destination }: { kind: 'library' }, or { kind: 'ticket' | 'redmine', id }. The destination is checked, then signed into the capability token's context, which PulseVault stores with the upload and hands back to onUploadComplete. There is still no reservation table.
Delivery moves to meteor-backend/server/pulse-destinations.js, shaped like pulsevault's examples/meteor-demo: one DESTINATIONS entry per kind, with check (run at reserve, and again at delivery) and deliver (idempotent on the video id, since PulseVault replays a completion it never saw recorded).
Changes
pulse-destinations.js (new): library, ticket, redmine. resolvePulseDestination for the reserve; deliverPulseVideo for the completion, returning { state: 'done', note } or { state: 'kept', reason }.
pulsevault.js: attachUploadedVideo and the inline reserve branches are gone. onUploadComplete is three lines: describe the video, deliver, record the outcome. The attachment title stays Video <id8>.
Kept, not thrown: a destination that is gone at delivery — not-found (ticket deleted, Redmine issue gone) or forbidden (the uploader left the team) — is recorded kept with the reason. Before, a forbidden at delivery would have been replayed every five minutes forever. Anything else (Redmine unreachable, a write failed) still throws, so PulseVault replays it.
pulsevault.reserveForLibrary removed: the library is a destination kind. Its five callers (videoApi.reserve({ kind: 'library' })) and the Wormhole schema are updated; existingVideoid is unchanged.
Tests:attachments.test.ts uses the new shape and no longer asserts on the pulsevault_reservations collection chore(pulsevault): upgrade to 0.5.0 #644 removed. New e2e case: a ticket deleted while its video uploads ends kept, with no attachment.
Testing
Local, at this commit, backend on :3101 against a scratch MongoDB replica set with VIDEOS_DIR set, frontend :3002 from the Playwright config:
tests/e2e/tickets/pulsevault.spec.ts + huddle/pulsevault-video.spec.ts + huddle/composer-actions.spec.ts: 26 passed, 0 skipped, no retries. That covers the library and ticket destinations end to end (device upload lands as an attachment), the new kept case, and the backend logging kept … Ticket not found — it was gone before the video finished uploading.
tsc --noEmit, npm run lint (0 errors), npm run format, vitest run src/features/pulse-upload (4/4): clean.
Not run: a Redmine-target upload (no Redmine here; its check is resolveTicketRef, the same call as on main), and an upload from the Pulse app on a phone.
Each kind has delivered(destination, video) next to check and deliver, asked first: a replay of a delivery whose outcome never got recorded returns the same done, whatever has become of the destination since.
destinationOf in pulsevault.js reads a token minted by the previous reserve ({ target, ticketId }, chore(pulsevault): upgrade to 0.5.0 #644, deployed to DEV) as a destination, for the 30 minutes such a token stays valid. Marked for removal after that window.
An unknown kind in a context settles as kept instead of throwing from the hook.
After Copilot's review of 208a076 (3cf1a60): the draft-name title is dropped so this stage stays invisible to people; it returns with the Huddle stage and its release note.
Next
Stage 2 is one Pulse button (usePulseUpload with no detached watcher), then the Huddle, Clock and timesheet destinations as one small PR each, then removing raw video uploads. #615 and #616 stay open as the reference until the stack lands.
…vers it
`pulsevault.reserve` takes `{ destination }` — `{ kind: 'library' }`, or
`{ kind: 'ticket' | 'redmine', id }` — checks it, and signs it into the
capability token's context. `onUploadComplete` hands that context to
`pulse-destinations.js`, where each kind is one entry: `check` runs at
reserve and again at delivery, `deliver` is idempotent on the video id.
A destination that is gone by delivery (the ticket deleted, the uploader
out of its team) is recorded `kept` with the reason instead of attaching
to nothing; anything else still throws, so PulseVault replays it.
`pulsevault.reserveForLibrary` folds into `reserve`: the library is a
destination kind. The attachment title is the Pulse draft's name when one
was sent.
…tination token still lands
Each destination kind now says whether this video was already delivered
(`delivered`) before anything is checked, so a replay after the outcome
went unrecorded gets the same `done` as the first time even if the ticket
has since been deleted or the uploader has left the team.
A token minted by the previous `reserve` carries `{ target, ticketId }`
in its context rather than `destination`; `destinationOf` reads both for
the thirty-minute window in which such an upload can still complete or be
replayed. An unknown kind settles as `kept` instead of throwing from the
hook, which would have replayed it every five minutes.
This changes the visible title of Pulse videos from Video <id> to the draft name (for example, ProfileFeed renders item.title), but the PR adds no release-note entry. The repository requires every user-visible change to ship in release-notes/ (release-notes/README.md:10-12); please add this behavior to the current version's note.
Reply to the "previously missed" finding in Copilot's review of 208a076 (it has no review thread). Add release note for Pulse video title change: the title change is gone in 3cf1a60 — describeVideo keeps Video <id8> as on main, so this stage changes nothing a person sees and needs no note. Using the Pulse draft's name is part of the Huddle stage, where it becomes the post's text, and ships with that release note.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
The critical replay-before-revalidation behavior lacks regression coverage.
Review effort: Balanced Findings: None
Previously missed (1)
In code that hasn't changed since last review
Add regression test for replay-before-revalidation attachment handling
meteor-backend/server/pulse-destinations.js:168
The replay-before-revalidation behavior has no automated regression coverage. The current e2e case only exercises an undelivered ticket becoming not-found; it would still pass if these lines were reordered and a successfully attached upload were later recorded as kept after deletion or membership loss. Add a case that delivers once, leaves the PulseVault completion unacknowledged, removes access/the destination, replays completion, and asserts the outcome remains done with one attachment.
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I checked these: old { target, ticketId } links still map through destinationOf; redelivery is safe because delivered runs before the access check; the token only carries kind plus what the server-side check returns; prototype names like constructor are rejected as kinds; Redmine errors other than not-found still throw so the upload is retried; nothing still calls reserveForLibrary. One small wording issue is commented inline.
The reason will be displayed to describe this comment to others. Learn more.
Nit: this suffix also gets added when err.error === 'forbidden', for example when the uploader was removed from the ticket's team mid-upload. The ticket still exists in that case, so "it was gone before the video finished uploading" is wrong. Use a different suffix for forbidden (e.g. "you no longer have access to it"), or just show err.reason alone.
Two conflicts: release-notes/1.0.6.md, where main had started the 1.0.6 note with the
confetti and App Store changes and this branch had started it with Pulse (1.0.6 is not
tagged, so the two become one note with both), and the Playwright import line in
tests/e2e/tickets/helpers.ts, which now takes APIRequestContext, Page and Route.
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
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
Stage 1 of landing #615 in pieces on top of 0.5.0 (#644). This one is the foundation the Huddle, Clock and timesheet destinations will build on, and it changes nothing a person sees.
pulsevault.reservenow takes{ destination }:{ kind: 'library' }, or{ kind: 'ticket' | 'redmine', id }. The destination is checked, then signed into the capability token'scontext, which PulseVault stores with the upload and hands back toonUploadComplete. There is still no reservation table.Delivery moves to
meteor-backend/server/pulse-destinations.js, shaped like pulsevault'sexamples/meteor-demo: oneDESTINATIONSentry per kind, withcheck(run at reserve, and again at delivery) anddeliver(idempotent on the video id, since PulseVault replays a completion it never saw recorded).Changes
pulse-destinations.js(new):library,ticket,redmine.resolvePulseDestinationfor the reserve;deliverPulseVideofor the completion, returning{ state: 'done', note }or{ state: 'kept', reason }.pulsevault.js:attachUploadedVideoand the inline reserve branches are gone.onUploadCompleteis three lines: describe the video, deliver, record the outcome. The attachment title staysVideo <id8>.not-found(ticket deleted, Redmine issue gone) orforbidden(the uploader left the team) — is recordedkeptwith the reason. Before, aforbiddenat delivery would have been replayed every five minutes forever. Anything else (Redmine unreachable, a write failed) still throws, so PulseVault replays it.pulsevault.reserveForLibraryremoved: the library is a destination kind. Its five callers (videoApi.reserve({ kind: 'library' })) and the Wormhole schema are updated;existingVideoidis unchanged.attachments.test.tsuses the new shape and no longer asserts on thepulsevault_reservationscollection chore(pulsevault): upgrade to 0.5.0 #644 removed. New e2e case: a ticket deleted while its video uploads endskept, with no attachment.Testing
Local, at this commit, backend on :3101 against a scratch MongoDB replica set with
VIDEOS_DIRset, frontend :3002 from the Playwright config:tests/e2e/tickets/pulsevault.spec.ts+huddle/pulsevault-video.spec.ts+huddle/composer-actions.spec.ts: 26 passed, 0 skipped, no retries. That covers the library and ticket destinations end to end (device upload lands as an attachment), the new kept case, and the backend loggingkept … Ticket not found — it was gone before the video finished uploading.meteor-backend/tests/attachments.test.ts(Redmine reserve refusal): 5/5.tsc --noEmit,npm run lint(0 errors),npm run format,vitest run src/features/pulse-upload(4/4): clean.Not run: a Redmine-target upload (no Redmine here; its check is
resolveTicketRef, the same call as onmain), and an upload from the Pulse app on a phone.After Copilot's review (208a076):
delivered(destination, video)next tocheckanddeliver, asked first: a replay of a delivery whose outcome never got recorded returns the samedone, whatever has become of the destination since.destinationOfinpulsevault.jsreads a token minted by the previousreserve({ target, ticketId }, chore(pulsevault): upgrade to 0.5.0 #644, deployed to DEV) as a destination, for the 30 minutes such a token stays valid. Marked for removal after that window.keptinstead of throwing from the hook.tickets/pulsevault.spec.ts15 passed,huddle/pulsevault-video.spec.ts2 passed,attachments.test.ts5/5, lint and Prettier clean.After Copilot's review of 208a076 (3cf1a60): the draft-name title is dropped so this stage stays invisible to people; it returns with the Huddle stage and its release note.
Next
Stage 2 is one Pulse button (
usePulseUploadwith no detached watcher), then the Huddle, Clock and timesheet destinations as one small PR each, then removing raw video uploads. #615 and #616 stay open as the reference until the stack lands.