Repository navigation
Replies: 1 comment
|
Thank you for the report. This has been fixed in v0.11.8. The recording fetched for the link is reused, so its details are downloaded once. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
Deep-linking to a recording that is not present in the currently loaded list page downloads the full recording detail twice in immediate succession, two identical responses of 306,485 bytes each. The first request is issued by
selectRecordingByIdto resolve the record that is not in the loaded list, and the second is issued unconditionally insideselectRecording, whichselectRecordingByIdthen calls with the just-fetched record.This doubles the SQL and Markdown rendering work for that load and accounts for 612,970 of 4,911,730 bytes (12.5%) of the cold detail load. The
_hydratingSelectedRecordingflag already prevents a redundant request on the normal selection path by guarding the hydration watcher, but it does not protect the second fetch insideselectRecording.Affected Version
v0.11.7
Requested Feature
Pass the record already fetched by
selectRecordingByIdintoselectRecordingso the second detail fetch is skipped, while keeping the fetch for the normal selection path where no record is available yet. This can be done with an option flag (for example ahydratedargument) or a hydrated-record argument that letsselectRecordingreuse the supplied full record instead of fetching/api/recordings/{id}again.Proposed Implementation
selectRecordinginstatic/js/modules/composables/recordings.js:228that indicates the caller already holds the full record, for exampleselectRecording(recording, { hydrated: true })or an equivalent hydrated-record argument.static/js/modules/composables/recordings.js:275-305, skip thefetch('/api/recordings/${recording.id}')call when the record is already hydrated, and instead use the supplied record asfullRecordingso the subsequent assignment, index update, status polling, and view switch still run.selectRecordingByIdatstatic/js/modules/composables/recordings.js:338-353to pass the hydrated flag (or the fetched record) when it callsselectRecording, since it has just fetched the full record atstatic/js/modules/composables/recordings.js:346.static/js/modules/composables/recordings.js:279._hydratingSelectedRecordingflag logic atstatic/js/modules/composables/recordings.js:268andstatic/js/modules/composables/recordings.js:303intact, since it guards the hydration watcher on the normal path.Expected Behavior
GET /api/recordings/{id}exactly once instead of twice.recordings, starts auto-polling when the status isPROCESSINGorSUMMARIZING, and switches to the detail view, exactly as it does today.Root Cause Analysis
selectRecordingByIdatstatic/js/modules/composables/recordings.js:338-353resolves a missing record by fetching/api/recordings/${id}atstatic/js/modules/composables/recordings.js:346, then callsselectRecording(await resp.json())atstatic/js/modules/composables/recordings.js:348.selectRecordingatstatic/js/modules/composables/recordings.js:228unconditionally fetches the same URL again atstatic/js/modules/composables/recordings.js:279, because its detail block atstatic/js/modules/composables/recordings.js:275-305always performs the fetch and has no way to know the caller already holds the full record.The
_hydratingSelectedRecordingflag atstatic/js/modules/composables/recordings.js:268is set beforeselectedRecording.value = recordingand cleared atstatic/js/modules/composables/recordings.js:303, but it only prevents the hydration safety-net watcher from issuing its own request; it does not short-circuit the fetch insideselectRecording. Measured against v0.11.7 on a recording whose detail body is 306,485 bytes, deep-linking therefore issues two identicalGET /api/recordings/<id>requests with that body back to back.Additional Context
Measured against v0.11.7 on a recording whose detail body is 306,485 bytes: deep-linking to it issues
GET /api/recordings/<id>twice back-to-back with identical bodies, 612,970 bytes of 4,911,730 bytes (12.5%) of the cold detail load.The fix is a small frontend change in
static/js/modules/composables/recordings.js:275-305with no backend, data model, or migration impact.All reactions