Skip to content

Pulse Opens Through Its Universal Links in One Tap, and TimeHuddle No Longer Manages Pulse's App Store Links - #678

Closed
morepriyam wants to merge 2 commits into
feat/videos-upload-linksfrom
feat/video-conform
Closed

morepriyam wants to merge 2 commits into
feat/videos-upload-linksfrom
feat/video-conform

Conversation

@morepriyam

@morepriyam morepriyam commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Pulse now opens through its own Universal Link / App Link, and TimeHuddle no longer manages Pulse's App Store / Play Store links. On a phone, one tap on Pulse opens the app; when Pulse isn't installed, Pulse's page takes the person to the App Store or Google Play and connects after the install. TimeHuddle only hands out the link.

Built on @mieweb/pulsevault 0.6.0 (the latest release): buildUploadLink({ form: 'https' }) gives https://mieweb.github.io/pulse/open#v=1&artifactId=…&server=…&token=…. The released Pulse app claims that host; its apple-app-site-association and assetlinks.json are live for com.mieweb.pulse. The upload rides in the fragment, so the link host never receives the token.

PR on #709: the video and UI work that used to ride along here now ships in #709, #710 and #711; this PR is only the universal links, and waits on Pulse's App Store / Play Store release. See Stack and merge order below.

How Pulse opens now

Where Tapping Pulse
Phone browser Opens Pulse in one tap. A Universal Link opens the app only from a tap, not from a navigation that waited on the server, so the link is reserved while the chip is on screen and the tap follows it straight away.
TimeHuddle app The OS opens Pulse from the link (AppLauncher.openUrl).
Computer A QR code of the same link; the phone's camera opens Pulse.
Pulse not installed Pulse's page sends the person to the App Store or Google Play, and the link connects after the install.

TimeHuddle no longer manages Pulse's App Store / Play Store links

Gone:

  • the Pulse App Store / Play Store links (PULSE_STORE_URLS) and opening them;
  • guessing whether Pulse is installed: the focus/blur timers (openPulseAppOrStore), the native canOpenUrl check (openNativePulseOrStore), the Android intent:// link with its Play Store fallback;
  • the App Store / Google Play badges in the Pulse window (PulseStoreBadges);
  • the pulsecam scheme queries in ios/App/App/Info.plist (LSApplicationQueriesSchemes) and AndroidManifest.xml (<queries>), which existed only for that check (takes effect with the next native build);
  • the backend's /pulse/open store interstitial (300 lines): now a 302 to Pulse's link with only the pairing parameters, kept for QR codes an older app bundle may still show.

Still there, and why: the account menu's Help → App Store is TimeHuddle's own listing, not Pulse's; the Pulse window's "No Pulse yet? Your phone goes to the App Store or Google Play first." is plain text, linking nowhere.

Changes

  • src/features/pulse-upload/pulseLinks.ts: buildPulseLink builds the one https pairing link (QR target and phone link alike). The package exports buildUploadLink only from its server entry points, so it's built here; a unit test checks the two are identical.
  • usePulseUpload: in a phone's browser the destination's link is reserved while the chip is mounted (reserving writes nothing, it signs a token; an unused one expires), refreshed every 20 minutes (tokens last 30) and after each use, and the tap follows it before anything is awaited. Only if no link is ready yet does the tap reserve and show the window with an Open Pulse link, so it never lands on the wrong page. The TimeHuddle app hands the link to the OS; a computer shows the QR.
  • PulseUploadModal: the QR (computer) or Open Pulse (phone fallback), one line about the store instead of the badges.
  • src/lib/device.ts: down to isNativeApp, getMobileOS, isMobileBrowser, openExternalUrl.
  • meteor-backend/server/pulse-link.js: the /pulse/open redirect; verifyUploadToken no longer exported.
  • Native: pulsecam queries removed from Info.plist and AndroidManifest.xml.

Screenshots

Pulse window on a computer: the QR of Pulse's link, no store badges

17-pulse-window-desktop

On a phone held sideways (the QR beside the words)

13-pulse-window-landscape

Tests

  • Unit: pulseLinks.test.ts checks buildPulseLink equals the package's buildUploadLink({ form: 'https' }) and keeps the token in the fragment; device.test.ts covers what's left.
  • e2e (tickets/pulsevault): the QR window on a computer; one tap in an iPhone browser lands on Pulse's https link (Pulse's page stubbed); /pulse/open?… redirects there with only v, artifactId, server, token.
  • By hand, headless iPhone 13 and Pixel 7 browsers: one tap from a ticket and from Clock out with Pulse lands on the link, with no window; a computer still gets the QR.
  • On this branch (after the split): typecheck, lint, format clean; unit tests 586 / 586.
  • Before the split, the focused e2e set on the old head (tickets/pulsevault, tickets/video-upload, redmine/issue-detail, timesheet/walkthrough, timers/clock-in-then-start, huddle/pulsevault-video): 51 passed; full suite 424 passed, the 6 failures being the mail-dependent specs. Not re-run on the split branch.

Not tested

  • Real phones with and without Pulse installed: the one-tap and store paths were checked in emulated browsers.
  • The TimeHuddle app's path (AppLauncher.openUrl of a Universal Link) and the removed pulsecam queries need a native build.

Stack and merge order

This work used to ship as one PR (#678). It is now five, so each can be reviewed on its own and the universal links can wait for Pulse's store release without holding the rest back.

Order PR Base What
1 #709 main Upload beside Pulse, every video converted; links in the text, Videos everywhere
2 #710 #709 The Clock page's Pulse card, a pending change and an upload's progress
2 #678 #709 Pulse opens through its universal links (waits on Pulse's App Store / Play Store release)
2 #616 #709 Pulse video cards
3 #711 #710 Timesheets as a list of sessions; the Work page in one layout

The three PRs in step 2 are independent of each other and can merge in any order once #709 is in. #711 follows #710. When a base PR merges, retarget the next one to main (GitHub does it when the merged branch is deleted).

Expected conflicts when the step-2 PRs merge after each other, all small:

Merged together, the five come out identical to the old #678 head plus the timesheet work and the video cards (checked file by file). The old heads are tagged backup/video-conform-2026-10-13 and backup/pulse-video-cards-2026-10-13.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

🚀 Preview Deployment Ready

Service URL
App https://mieweb-timehuddle-feat-video-conform.os.mieweb.org
API (Meteor) https://mieweb-timehuddle-feat-video-conform-api.os.mieweb.org

Preview auto-deletes when this PR is closed.

morepriyam added a commit to mieweb/pulsevault that referenced this pull request Oct 8, 2026
…ady (#84)

Found checking TimeHuddle's integration (mieweb/timehuddle#678): its
describeVideo names the media item's file and type from ctx.webReady. When
delivery threw and the replay retried it, the conversion was already
recorded, so the replayed hook ran without ctx.webReady and a WebM
conformed to MP4 was filed as video/webm. contextFor now carries the
recorded result (new test fails before the fix).

Also: the rotation test's fixture falls back to the `rotate` tag on FFmpeg
before 6.0 (no -display_rotation), so the suite runs on Debian bookworm's
FFmpeg 5.1.
morepriyam added a commit to mieweb/pulsevault that referenced this pull request Oct 12, 2026
…common containers (#84) (#85)

* feat: conform uploaded videos to one web-playable format, accept the common containers (#84)

webReady becomes a conform step. Every finished video is brought to
CONFORM_TARGET, the format the Pulse app records: faststart MP4, H.264 8-bit
yuv420p with even dimensions, SDR, longest edge at most maxEdge (1920),
rotation applied, AAC or no audio. A file already in it keeps its bytes
(none); a moov at the end is a lossless remux; otherwise one ffmpeg run
re-encodes only the off-target streams (HEVC, 10-bit HDR tone-mapped, 4K
scaled, Opus/PCM to AAC). Another container (.mov, .m4v, .webm, .mkv, .3gp,
.avi) becomes a new <id>.mp4 (conformed): the sidecar switches ext,
converted and webReady in one write, then the original is deleted;
sourceExt lets remove() clean up a crash leftover.

- webReady.timeoutSeconds (default 60 + 10 x duration) kills a stuck run;
  the original serves and skipped is recorded with the reason.
- The result is recorded on the artifact and reported by the status route
  as webReady { action, reason } (protocol 2.4).
- core.conformAvailable() for a host's health check.
- createVideoValidator(): content check by ffprobe (video stream, duration
  > 0, optional maxDurationSeconds) with plain 422 reasons; sniffVideo
  fallback without ffprobe.
- 413 "That file is larger than 500 MB." instead of tus's message.
- Default video allowedExtensions: the seven containers above.
- Local resolve() re-reads the sidecar once when the cached file is gone
  (another instance switched it).
- web-ready-migrate.mjs conforms existing artifacts the same way.

* docs: conform target, accepted containers, settings and the ffmpeg requirement (#84)

* fix: review and local test-run findings on the conform step (#84)

From a local run over real files (the conform corpus, edge cases, FFmpeg
9.0 and 7.1) and Copilot's review of #85:

- Full-range video (an iPhone screen recording's yuvj420p) came out still
  full range, and was converted again on every pass: scale to limited
  range (out_range=tv) before format=yuv420p.
- A picture renamed as a video (PNG, JPEG, GIF, an iPhone HEIC) passed the
  validator and was "converted": an image demuxer or a one-frame stream is
  not a video.
- remove() raced a conversion's switch to a new file and could write the
  sidecar back after a delete (0/300 clean before, 300/300 after): it now
  runs under the sidecar lock and reads the sidecar itself.
- A conversion queued behind others re-reads the artifact when its turn
  comes (removed, or converted by another instance meanwhile), and a
  failed run never records over a finished one.
- While a video converts, its URL is served with max-age=0 instead of the
  configured (possibly immutable) cache.
- Sizes round down to even, so an odd maxEdge stays a cap.
- Docs: SDR sources keep their colour tags (only HDR is converted to
  BT.709); transcode:false still runs lossless remuxes.
- CI installs ffmpeg so the conform tests run there (they all skipped).

* fix: the default conversion timeout scales with the video's pixel rate (#84)

An iPhone 4K 120 fps HDR clip (38 s, 4,520 frames) was killed at the old
default (60 + 10 x duration = 437 s) and served unconverted, though nothing
was wrong with it: it needs ~450-520 s on an M-series Mac. The default now
counts the duration in 1080p30 seconds (a 4K120 second counts 16), keeping
it a guard against a hung run rather than a speed limit.

* test: wait for the acknowledgement the replay records after its hook returns

The test checked acknowledged right after the hook ran; the flag is written
once the hook has returned. It never ran in CI before (no ffmpeg there) and
lost that race on the node 22 runner.

* fix: replay and status name the tus upload by its uploaded extension (#84)

After a container change `meta.ext` is the stored file's (`.mp4`), but
tus's record of the upload and `filename` keep the uploaded one (`.webm`).
describeArtifact now reports it as `sourceExt`, and `uploadIdOf(meta)`
names the upload by it, so a replayed hook's `ext` and `uploadId` match
`filename` and the status route asks tus for the right upload.

* test: remove the web-ready tests' scratch directories when they finish

The fixture helpers made a temp directory per test and never removed it;
a few local runs left hundreds behind.

* fix: Copilot rounds 3-5 on the conform step (#84)

Cross-instance (shared workspace, a documented deployment):
- The local adapter changes a sidecar under a per-artifact lock file
  (`<id>.json.lock`, created with wx; taken over after 30 s from a crashed
  holder) as well as its in-process lock, and remove() runs under it. Two
  adapters on one workspace racing a delete or an acknowledgement against a
  conversion's switch: the pre-fix code failed this 3/3, now passes.
- Patch field `unlessConverted`: a failed run never records over another
  pass's conversion; the runner then makes the files match whichever
  record stands (the original goes only once the record names the new file).

GET: wait for the file stream to open before sending headers; on ENOENT
(a conversion just replaced the file) resolve once more instead of a 404 or
a cut-off response. Bytes resolved under an extension storage no longer
names are served with max-age=0.

ffprobe: every run over an upload is bounded (probeTimeoutSeconds, default
60); the validator refuses with "That video couldn't be checked in time."
and defaults its logger to console. A stream without a frame count (MKV,
WebM) is checked for two packets, so a one-frame MKV isn't a video.
color_range=pc counts as off-target.

ensureWebReady validates maxEdge/timeoutSeconds/probeTimeoutSeconds itself;
a failed run records "ffmpeg exited with code N", never ffmpeg's output
(server paths); HDR on an ffmpeg without tone mapping is left as uploaded
(skipped) instead of converted with wrong colours. webReady needs
describeArtifact.

* fix: install a conversion only on the reservation it began on; reserve under the sidecar lock (#84)

Copilot round 6 on #85:
- Each reservation gets a `generation`; the runner converts into a temp
  .mp4 (`install: false`) and installs it with one locked patch (`file`,
  `ext`, result) conditioned on that generation and on no other pass having
  recorded a conversion. A conversion that outlived its upload (removed,
  then the id reserved again) can no longer record onto, or rename its file
  over, the new upload. patchArtifact resolves false when a condition
  doesn't hold; the runner then drops its file.
- reserveUpload runs under the sidecar lock and remove() deletes the
  sidecar last, so a new upload of a removed id never loses its bytes to
  the old removal.

* fix: owned, renewed sidecar locks; streamed packet scan; plain 413 mid-stream; transcode:false is skipped (#84)

Copilot round 7 on #85:
- The lock file holds its owner's token; the holder renews it every 10 s
  and removes it only while it's still its own, so a stalled holder that
  resumes can't delete a successor's lock. A stale lock (not renewed for
  30 s) is taken over by an atomic rename; a taker that renamed a fresh
  lock by losing a race puts it back with link().
- packetDuration streams ffprobe's packet list line by line, keeping only
  the latest end, instead of buffering up to 256 MiB per probe.
- A deferred-length upload going past maxUploadSize gets the plain 413,
  whether tus refuses the chunk by its Content-Length or cuts a chunked body
  off mid-stream (StreamLimiter's own error object); a chunk past the
  length the client declared keeps tus's wording.
- transcode:false records an off-target file as skipped, not none (none
  means it conforms).

* fix: lock ownership, streamed packet scan, plain 413 mid-stream, transcode:false is skipped (#84)

Copilot round 7 on #85:
- Sidecar lock file holds its owner's token, is renewed every 10 s while
  held, and is removed only by its owner; a lock not renewed for 30 s is
  taken over by an atomic rename (put back with link if it turns out fresh).
- The packet-duration scan streams ffprobe's output and keeps only the
  latest end, instead of buffering up to 256 MiB per upload.
- The plain "That file is larger than …" 413 also covers StreamLimiter's
  mid-stream error and a deferred-length upload growing past the cap.
- transcode:false records a file it leaves off-target as `skipped`; `none`
  means only "already conforms".

Also from a load run: remove() decides from the sidecar alone. With the
sidecar now removed last, a read racing the removal could re-cache the
artifact, and a second remove trusted that cache and reported it removed
twice (seen once as a retention-test flake under three parallel suites).

* fix: GET checks the opened file is the one its headers describe; one stale-lock takeover at a time (#84)

Copilot round 8 on #85:
- After the file stream opens, fstat its descriptor and compare inode,
  device, size and mtime with the stat send() built the headers from; a
  file renamed onto the same path in between (an in-place conversion) is
  closed and the artifact resolved again, before anything is written.
- Stale-lock takeover runs under an exclusive `<lock>.recovery` file and
  looks at the lock again inside it, so a lock released and taken afresh
  meanwhile is never removed (replaces the rename-and-link restore).
- The validator's limit reads exactly as configured ("1 minute 1 second").

* docs(changelog): GET's file check, serialized stale-lock takeover, exact limit wording (#84)

* fix: completion work belongs to the reservation it was scheduled for (#84)

Copilot round 9 on #85: a conversion queued for upload A re-read the id
when its turn came and adopted whatever owned it then. If A was removed and
the id reserved again as B (still uploading), A's job converted B's
partial bytes under B's generation (the new test fails on the previous
commit with B `converted: true`), B's completion could join A's settle
(keyed by id only), and A's acknowledgement could suppress B's hook.

The generation is captured when work is scheduled: the queued job requires
the same generation (and a finished upload) at its turn, the settle map is
keyed by id and generation, and the acknowledgement patch is conditioned on
it.

* fix: fresh local path, bounded capability queries, observer failures, migrate rerun cleanup (#84)

Copilot round 10 on #85:
- getLocalPath reads the sidecar instead of the cache: another instance
  may have removed the id and reserved it again under a new extension, and
  the conversion must probe today's file (test fails on the previous
  commit).
- ffmpeg -version / -h filter=scale / -filters are killed after 30 s, so a
  hanging capability query can't hold a queue slot forever.
- A throwing `processed` observer is logged on its own and the recorded
  result still reaches completeAfter's hook (test fails on the previous
  commit).
- web-ready-migrate.mjs rerun deletes a leftover original whose sidecar
  already names the .mp4.

* fix: a replayed hook gets the recorded conversion result as ctx.webReady (#84)

Found checking TimeHuddle's integration (mieweb/timehuddle#678): its
describeVideo names the media item's file and type from ctx.webReady. When
delivery threw and the replay retried it, the conversion was already
recorded, so the replayed hook ran without ctx.webReady and a WebM
conformed to MP4 was filed as video/webm. contextFor now carries the
recorded result (new test fails before the fix).

Also: the rotation test's fixture falls back to the `rotate` tag on FFmpeg
before 6.0 (no -display_rotation), so the suite runs on Debian bookworm's
FFmpeg 5.1.

* chore: protocol 2.5 for the conform step (#84)

#86 (https pairing links) takes 2.4 and merges first, so webReady's
revision moves to 2.5: package.json, the history row, §6.5, the
status schema's descriptions and the CHANGELOG.

* refactor: no cross-instance sidecar lock; a converted video's file is always <id>.mp4 (#84)

The lock file (owner token, lease, recovery lock) couldn't fence a holder
that paused past its lease, and each fix to it opened another race. Back
to main's per-process serializer; across instances the last sidecar write
wins, as before. What a stale write could break — a sidecar from before a
conversion naming the deleted .webm — can't: the converted file is always
<id>.mp4, resolve/getLocalPath fall back to it, the next conversion pass
records the file it ran on again, and remove deletes <id>.mp4 too.

Also: a conversion that lost its record to another pass hands back the
recorded result only while the id is still its reservation's.

Tests: the lock tests go; the two-instance test writes a pre-conversion
sidecar back and checks the converted file still serves and is removed;
the WebM test checks the replay repairs such a sidecar.

* fix: storedExt builds a path only from a real id and extension (#84)

CodeQL js/path-injection on the new fallback lookup: check the id is a
UUID and the extension is a plain one before joining them into a path,
as the rest of the local adapter does.

* fix: storedExt's path is checked to stay in its kind directory (#84)

CodeQL didn't count the UUID check as a sanitizer for js/path-injection;
resolve the path and check it stays inside the kind directory, the way
sidecarPath already does.

* fix: a stored extension is any extension allowedExtensions accepts (#84)

STORED_EXT (/^\.[a-z0-9]+$/) was stricter than the allowedExtensions rule,
so a custom extension like .my-video lost its sourceExt on re-read after a
conversion (replay, uploadIdOf and remove then used .mp4), and storedExt
refused to serve such a video at all. Use options.ts's EXTENSION_REGEX in
all three places; storedPath still keeps the path in its kind directory.

* fix: the default conversion timeout is at most an hour (#84)

It's computed from the upload's own duration, size and frame rate, so a
crafted file could advertise values worth a days-long run and hold the
queue. Capped at an hour (the unknown-duration default), and an hour when
the computed value isn't finite; an explicit timeoutSeconds still wins.

* fix: a retried final PATCH after a container change gets 204; conversions need a generation (#84)

- The local adapter's tus store answers for an upload a conversion
  replaced: tus kept its record, the file is gone, and a client re-sending
  the final PATCH got 410. It now reads as complete and its empty tail is
  taken without a write, so the retry reaches onUploadFinish's
  already-finished branch (204).
- A conversion runs only with a generation; an adapter offering
  getLocalPath without one has its videos recorded skipped, since a
  queued conversion couldn't tell its upload from a later one of the id.
  The local adapter's markReady gives one to an upload reserved before
  generations were kept.

Tests (each fails on the previous commit): the WebM retry/HEAD, a
generation-less adapter, an older sidecar at markReady.

* fix: odd rotations aren't converted, probe timeout floor, 1 byte, honest recovery claims (#84)

- A display matrix more than a degree off a quarter turn was rounded to
  one, so a 45° video would be scaled as portrait and distorted. Such a
  video is now skipped with the reason and served as uploaded; phones
  only record quarter turns.
- A sub-millisecond probeTimeoutSeconds rounded to 0, which Node treats
  as no timeout: at least 1 ms, as the ffmpeg timeout already was.
- "larger than 1 bytes" → "1 byte".
- OPERATIONS.md and the local adapter's comment no longer say nothing is
  lost across instances: completion bookkeeping recovers, a host's
  outcome lost to a stale write does not.

Test: a 45° rotation is skipped and its bytes kept (fails on the previous
commit). 239/239.

* fix: a durationless video's length is its packet span, not its last timestamp (#84)

packetDuration returned the last packet's end, and clamped negative
timestamps to zero, so a WebM without a header duration whose
timestamps start above zero read as longer, and one starting below zero
could read as shorter than it is (slipping under maxDurationSeconds).
It now returns last end minus first start, over every numeric
timestamp.

Test: a piped WebM starting at 100 s measures 1 s (fails on the previous
commit). 240/240.
@morepriyam
morepriyam changed the base branch from feat/pulse-timesheet to main October 12, 2026 21:09
@morepriyam
morepriyam marked this pull request as ready for review October 12, 2026 22:13
Copilot AI balanced review requested due to automatic review settings October 12, 2026 22:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Upload readiness and destination-switch races can cause premature attachments, duplicate deliveries, or stale UI state.

2 open findings
What changed in this PR

Adds a unified video-upload path that validates and converts common formats to browser-ready MP4 before delivery.

Changes:

  • Adds server-side validation/conversion with ffmpeg and PulseVault 0.6.0.
  • Adds reusable local-file upload controls across attachments, Huddle, profiles, and timesheets.
  • Adds unit/E2E coverage and release documentation.
File Description
Dockerfile Installs ffmpeg.
meteor-backend/​server/​pulsevault.js Configures validation and conversion.
meteor-backend/​package.json Upgrades PulseVault.
meteor-backend/​package-lock.json Locks backend dependency.
package.json Upgrades frontend PulseVault.
package-lock.json Locks frontend dependency.
src/​lib/​api.ts Stops retrying upload refusals.
src/​lib/​useFileUploadLauncher.ts Removes obsolete media accept constant.
src/​features/​pulse-upload/​videoFile.ts Adds shared upload helpers.
src/​features/​pulse-upload/​videoFile.test.ts Tests validation and errors.
src/​features/​pulse-upload/​usePulseUpload.ts Adds file-upload state and workflow.
src/​features/​pulse-upload/​PulseButton.tsx Adds the Upload chip.
src/​features/​clock/​AttachmentsPanel.tsx Enables attachment uploads.
src/​features/​clock/​ChangeRequestWalkthrough.tsx Enables walkthrough uploads.
src/​features/​clock/​TimesheetJustificationFields.tsx Uses shared video uploading.
src/​features/​timers/​WorkPage.tsx Repositions walkthrough controls.
src/​features/​huddle/​AttachmentBar.tsx Expands accepted video formats.
src/​features/​huddle/​api.ts Uses conformed library uploads.
src/​features/​profile/​ProfileFeed.tsx Uses shared library uploads.
tests/​e2e/​fixtures/​test-video.webm Adds a WebM fixture.
tests/​e2e/​tickets/​video-upload.spec.ts Tests conversion and refusal.
tests/​e2e/​huddle/​pulsevault-video.spec.ts Updates the video-input locator.
tests/​e2e/​huddle/​helpers.ts Updates helper locators.
tests/​e2e/​huddle/​composer-actions.spec.ts Updates composer locators.
release-notes/​1.0.6.md Documents local video uploads.
Files not reviewed (1)
  • meteor-backend/package-lock.json: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +252 to +253
const next = await reserve(true);
if (!next) return;
Comment on lines +81 to +84
const filed = await videoApi.waitUntilFiled(reservation.videoid, reservation.uploadToken);
// A timeout still leaves a video that serves; only a refusal is a failure.
if (filed.state === 'kept') throw new Error(filed.reason ?? "That video couldn't be added.");
return reservation.videoid;
morepriyam added a commit that referenced this pull request Oct 13, 2026
Copilot AI balanced review requested due to automatic review settings October 13, 2026 00:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Uploads can be attached before conversion completes, and stale upload state can leak across destination changes.

7 open findings
Files not reviewed (1)
  • meteor-backend/package-lock.json: Generated file

🧠 Review effort: Balanced

Comment on lines +256 to +262
await uploadVideoFile(file, next, (f) => mounted.current && setProgress(f));
} catch (e) {
if (!mounted.current) return;
// Nothing landed: drop the link so the chips are free again.
setLink(null);
setStatus(null);
setError((e as Error).message);
Comment thread src/ui/linkify.ts
Comment on lines +29 to +30
} else if (ch === ')' && !url.slice(0, end - 1).includes('(')) {
end--;
Comment on lines +368 to +370
<div className="session-actions inline-flex items-center justify-end gap-1">
{onVideos && (
<Button
Comment on lines +95 to +96
{allowFile && (
<span className="pulse-upload-chips inline-flex items-center gap-2">
Comment thread src/ui/linkify.ts
Comment on lines +7 to +8
export const linkClassName =
'text-blue-600 underline [overflow-wrap:anywhere] hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300';
morepriyam added a commit that referenced this pull request Oct 13, 2026
Copilot AI balanced review requested due to automatic review settings October 13, 2026 00:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The legacy redirect can forward users to attacker-controlled Pulse upload servers, and several new controls violate established UI and RTL conventions.

8 open findings
Files not reviewed (1)
  • meteor-backend/package-lock.json: Generated file
Previously missed (2)

In code that hasn't changed since last review

Medium severity Use logical start positioning for pending walkthrough row

src/​features/​clock/​TimesheetRow.tsx:401

This pending-walkthrough row uses the physical left-0, so it remains pinned left instead of to the visible start edge in RTL. Use the logical start-0 utility required by the repository's RTL convention.

Medium severity Use logical RTL positioning and shadow for Actions column

src/​features/​clock/​timesheetUtils.ts:117

right-0 pins the sticky Actions column to the wrong logical edge in RTL layouts. The repository's RTL rule requires logical positioning (end-0), and the one-sided shadow should also flip direction under RTL.

🧠 Review effort: Balanced

Comment on lines +25 to +27
for (const key of PAIRING_PARAMS) {
const value = from.get(key);
if (value) to.set(key, value);
@morepriyam morepriyam changed the title Conform Every Uploaded Video to the Pulse Format, and Upload Beside Pulse Pulse Opens Through Its Universal Links in One Tap, and TimeHuddle No Longer Manages Pulse's App Store Links Oct 13, 2026
Copilot AI balanced review requested due to automatic review settings October 13, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The legacy redirect permits untrusted upload servers, and shared uploads can report success before filing finishes.

8 open findings
Files not reviewed (1)
  • meteor-backend/package-lock.json: Generated file
Previously missed (2)

In code that hasn't changed since last review

Medium severity Allow 500 MB video attachments in Huddle

src/​features/​huddle/​api.ts:169

The Huddle composer still rejects every attachment over 100 MB in useAttachmentUpload.ts:17,59-67 before this shared video path runs. Consequently 100–500 MB videos work in the other new upload surfaces but fail in Huddle, contradicting this PR's 500 MB limit and release note. Apply the 500 MB limit for videos while retaining the media endpoint's 100 MB limit for photos/documents.

Low severity Use ButtonGroup for adjacent Approve and Decline actions

src/​features/​teams/​TimesheetApprovalsPanel.tsx:495

Approve and Decline are adjacent actions inside a custom flex wrapper, contrary to the required ButtonGroup pattern (.github/instructions/mieweb-ui.instructions.md:28-31). Wrap them in ButtonGroup and preserve the responsive width classes there so translated or longer labels receive the library's orientation and overflow behavior.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 13, 2026 03:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot AI balanced review requested due to automatic review settings October 13, 2026 03:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The legacy redirect loses its upload-server trust boundary, and several upload-state and UI-contract issues remain unresolved.

8 open findings
Files not reviewed (1)
  • meteor-backend/package-lock.json: Generated file
Previously missed (4)

In code that hasn't changed since last review

Medium severity Apply the 500 MB limit to Huddle videos

src/​features/​huddle/​api.ts:169

This Huddle video path is still gated by useAttachmentUpload's 100 MB MAX_ATTACHMENT_BYTES, so videos between 100 MB and the new shared/server 500 MB limit never reach uploadVideoToLibrary. That contradicts the new 500 MB message and the release note saying Huddle uses the same conversion path. Apply the 500 MB limit to Huddle videos (while retaining the smaller limit for other attachments), or document the lower Huddle limit.

Medium severity Group Pulse and Upload controls with ButtonGroup

src/​features/​pulse-upload/​PulseButton.tsx:113

These two adjacent controls are laid out with a custom span, bypassing the required ButtonGroup behavior for responsive and translated labels. Move the hidden input outside and group the Pulse and Upload buttons with ButtonGroup so labels such as the dynamic processing text are handled consistently.

Medium severity Group Approve and Decline controls with ButtonGroup

src/​features/​teams/​TimesheetApprovalsPanel.tsx:495

Approve and Decline are adjacent buttons but are still arranged with a custom flex container. The UI rules require ButtonGroup for this case; use its responsive grouping rather than hand-maintaining width behavior here.

Medium severity Prevent clipped preview links from receiving focus

src/​features/​timers/​WorkPage.tsx:935

LinkifiedText introduces focusable anchors inside a line-clamp-2/overflow-hidden preview. For a longer note, a URL after the second line remains in the tab order while being visually clipped, so keyboard users can focus an invisible link (and the comment's claim that the link stays visible is not true). Either render this preview without interactive links, remove the clamp, or provide an explicit expandable detail before making the links focusable.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 13, 2026 03:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The legacy redirect permits attacker-controlled upload destinations, and unconfirmed video filing outcomes are treated as successful.

8 open findings
Files not reviewed (1)
  • meteor-backend/package-lock.json: Generated file
Previously missed (2)

In code that hasn't changed since last review

Medium severity Preserve literal punctuation when removing Markdown syntax

src/​lib/​markdownText.ts:11

This removes Markdown marker characters wherever they occur, not only when they are syntax. Dashboard previews now run user-authored post text through this helper, so ordinary text such as C#, foo_bar, or 2 * 3 is silently changed. Parse Markdown structure (or restrict replacements to actual delimiters) so literal punctuation is preserved.

Low severity Use ButtonGroup for adjacent Approve and Decline actions

src/​features/​teams/​TimesheetApprovalsPanel.tsx:495

Approve and Decline are adjacent actions but are laid out with an ad-hoc flex wrapper. The @mieweb/ui component rules require two or more adjacent buttons to use ButtonGroup, which owns responsive label sizing and grouping behavior; replace this wrapper with ButtonGroup and add the corresponding import.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 13, 2026 03:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The legacy redirect currently permits attacker-controlled upload servers and forwards capability tokens without verification.

8 open findings
Files not reviewed (1)
  • meteor-backend/package-lock.json: Generated file
Previously missed (3)

In code that hasn't changed since last review

Medium severity Use logical start inset for RTL walkthrough positioning

src/​features/​clock/​TimesheetRow.tsx:402

This walkthrough is pinned with a physical left inset, so it stays on the wrong side of the horizontally scrolling table in RTL. Use the logical start edge required by the repository's RTL convention (.github/instructions/mieweb-ui.instructions.md:143).

Medium severity Use logical inset utility for RTL Actions column positioning

src/​features/​clock/​timesheetUtils.ts:117

Use the logical inset here. right-0 pins the final Actions column to the physical right even when RTL reverses the table, so the controls can be pinned to the wrong edge while scrolling; the repository requires start-*/end-* utilities for RTL (.github/instructions/mieweb-ui.instructions.md:143).

Medium severity Use ButtonGroup for adjacent Pulse and Upload controls

src/​features/​pulse-upload/​PulseButton.tsx:113

Pulse and Upload are adjacent buttons laid out with an ad-hoc flex wrapper, contrary to the repository's required ButtonGroup usage (.github/instructions/mieweb-ui.instructions.md:28-31). Wrap the two visible controls in ButtonGroup and keep the hidden file input outside it so the library can manage responsive labels and spacing.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 13, 2026 03:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The legacy redirect permits attacker-controlled upload servers, and some unconfirmed uploads are treated as successfully filed.

8 open findings
Files not reviewed (1)
  • meteor-backend/package-lock.json: Generated file
Previously missed (3)

In code that hasn't changed since last review

Medium severity Use RTL-safe end positioning for the sticky action column

src/​features/​clock/​timesheetUtils.ts:117

The new sticky action column is physically pinned with right-0, so in RTL layouts it remains on the right instead of the logical end. This violates the repository's RTL-safe utility convention (AGENTS.md:140) and makes horizontal scrolling behave backwards for RTL users. Use end-0 here (and mirror the directional shadow if needed).

Medium severity Handle balanced parentheses in Markdown link destinations

src/​lib/​markdownText.ts:10

This Markdown-link regex stops at the first ), so valid destinations containing parentheses leave an extra closing delimiter in the preview. For example, [wiki](https://en.wikipedia.org/wiki/Foo_(bar)) becomes wiki) on the dashboard/command palette. Use the Markdown parser's AST/plain-text output or otherwise handle balanced parentheses rather than parsing link destinations with [^)]+.

Low severity Use ButtonGroup for adjacent Pulse and Upload controls

src/​features/​pulse-upload/​PulseButton.tsx:127

These newly adjacent Pulse and Upload controls are laid out with an ad-hoc flex wrapper instead of ButtonGroup. The repository rule requires every adjacent button set to use ButtonGroup so responsive sizing and label overflow are handled consistently (AGENTS.md:25-30). Keep the hidden input outside the group and wrap the two visible controls in ButtonGroup.

🧠 Review effort: Balanced

…ndles the app store

Squashed from:

* feat(pulse): pair through Pulse's https link; TimeHuddle no longer handles the app store

  @mieweb/pulsevault 0.6.0 builds the https pairing link
  (`buildUploadLink({ form: 'https' })`, https://mieweb.github.io/pulse/open#…),
  a Universal Link / App Link the released Pulse app claims (the domain's
  apple-app-site-association and assetlinks.json are live). Pulse opens from it
  when installed; otherwise Pulse's page sends the person to the App Store or
  Google Play and keeps the link for after the install. So TimeHuddle stops
  deciding any of that:

  - pulseLinks.ts builds that one link (QR target and phone link alike), with
    the upload in the fragment; a unit test checks it equals the package's
    buildUploadLink output.
  - usePulseUpload: the TimeHuddle app hands the link to the OS
    (openExternalUrl → AppLauncher.openUrl); a browser opens the window — a QR
    on a computer, an "Open Pulse" link on a phone (a Universal Link opens the
    app only from a tap, and the tap that started it waited on the reservation).
  - Removed: device.ts's store fallback (openPulseAppOrStore with its
    focus/blur timers, openNativePulseOrStore's canOpenUrl check, the Android
    intent:// link, PULSE_STORE_URLS, getStoreOS), PulseStoreBadges and the
    window's store badges, and the pulsecam query entries in Info.plist and
    AndroidManifest.xml that existed only for canOpenUrl (takes effect with
    the next native build).
  - meteor-backend /pulse/open, the 300-line store interstitial, is now a 302
    to the Pulse link (pairing params only, in the fragment), for QR codes an
    older app bundle may still show. verifyUploadToken is no longer exported.

  Tests: pulseLinks (equals the package), device (what's left); e2e: the QR on
  a computer, "Open Pulse" with the https link in an iPhone browser, and the
  /pulse/open redirect.

* docs(release-notes): Pulse opens from its own link, and the store when it isn't installed (#678)
Squashed from:

* feat(pulse): one tap opens Pulse in a phone's browser

  A Universal Link / App Link opens the app only from a tap, not from a
  navigation that waited on the server, so the previous commit had a phone tap
  Pulse, then "Open Pulse". Now the link is ready before the tap: in a phone's
  browser usePulseUpload reserves the destination's link while the chip is on
  screen (reserving writes nothing, it signs a token; an unused one expires),
  refreshes it every 20 minutes (tokens last 30) and after each use, and the
  tap follows it before anything is awaited — one tap, Pulse is open (or the
  store, from Pulse's page). Only if no link is ready yet does the tap reserve
  and show the window with "Open Pulse". The TimeHuddle app (the OS opens the
  link) and a computer (QR) are unchanged.

  e2e: in an iPhone browser one tap on Pulse lands on the https pairing link.

* docs(release-notes): on a phone, Pulse opens straight away (#678)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines +400 to +403
await page.getByRole('button', { name: ticketTitle, exact: true }).first().click();
const prepared = page.waitForResponse((r) => r.url().includes('/api/pulsevault_reserve'));
await page.waitForURL(/\/app\/tickets\/[0-9a-f]{24}/);
await prepared;
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