[PER-10679] Replace navigateLean with getWithChildren in the publish functionality - #1135
Conversation
bf77982 to
72c4bfc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1135 +/- ##
==========================================
+ Coverage 53.60% 53.81% +0.20%
==========================================
Files 359 359
Lines 12383 12384 +1
Branches 2256 2256
==========================================
+ Hits 6638 6664 +26
+ Misses 5515 5488 -27
- Partials 230 232 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the folder publishing flow to use the Stela-backed getWithChildren API instead of navigateLean, and extends the Stela→FolderVO conversion to include folder timestamps so the publish dialog can reliably select the most recently updated published copy.
Changes:
- Map Stela
createdAt/updatedAtontoFolderVO.createdDT/updatedDTfor folders (including child folders). - Replace
navigateLean(publicRoot)withgetWithChildren([publicRoot])in the publish folder polling flow. - Expand unit tests to cover timestamp mapping and folder publish selection/error behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/app/shared/services/api/folder.repo.ts | Adds createdDT/updatedDT mapping in Stela folder conversion. |
| src/app/shared/services/api/folder.repo.spec.ts | Adds unit tests verifying timestamp mapping for folders and children. |
| src/app/file-browser/components/publish/publish.component.ts | Switches publish polling from navigateLean to getWithChildren and adds generic error handling. |
| src/app/file-browser/components/publish/publish.component.spec.ts | Updates mocks/tests for getWithChildren publish flow and adds coverage for selection and error handling. |
Suppressed comments (1)
src/app/file-browser/components/publish/publish.component.ts:90
- The polling loop picks
latestas the most recently updated folder across all public folders, then only checks whether that one folder’s name matches. If some unrelated public folder has a newerupdatedDTthan the newly-copied folder, this will never select the published copy and will keep retrying until it falls back, producing an incorrect/unused link.
const publicFolders: FolderVO[] = publicRootFull.ChildItemVOs.filter(
(i) => i instanceof FolderVO,
) as FolderVO[];
const latest = maxBy(publicFolders, (folder) => folder.updatedDT);
if (latest && latest.displayName === this.sourceItem.displayName) {
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
slifty
left a comment
There was a problem hiding this comment.
Two very very tiny points -- approving since they are really just cosmetic!
50d2476 to
25f05ef
Compare
01eddfb to
f22d6d7
Compare
f22d6d7 to
476f085
Compare
25f05ef to
a35c76a
Compare
476f085 to
91d528a
Compare
a35c76a to
e06059a
Compare
72580ae to
a02b7d2
Compare
e06059a to
9c30619
Compare
omnignorant
left a comment
There was a problem hiding this comment.
UAT passed on dev — branch PER-10679-replace-navigate-lean-publish, Dev build and deploy #1646, tested in Chrome plus a separate signed-out profile for the share preview. The build previously on dev was #1645 on PER-10476-replace-navigate-min, so the before/after comparison is against this PR's own base branch rather than main.
8 of the 9 QA scenario groups pass, both starred ones included. Not tested: the Internet Archive action — an outbound third-party submission from dev was out of scope for this pass.
One observation for follow-up, not a finding against this PR: in the public gallery, any item with no Date captions as "Invalid Date NaN, NaN". It reproduces on a folder published before this branch was deployed, and dated records render correctly, so it looks like missing-date handling in the caption rather than the timestamp mapping here.
Full report with screenshots and a reproduce-it audit plan is in the UAT folder.
The publish dialog polls the public route in order to find the copy that was just made. Now the polling will happen through getWithChildren. Issue: PER-10679
a02b7d2 to
9c89a8a
Compare
Warning
Do not merge before #1132 , this PR depends on the mappings from that specific PR
Depends on accessRole being on stela records and folders
Manual test cases
Publishing a folder ⭐
The happy path
undefined, noNaN, no empty segment between slashes. The archive segment should end in-0000.Publishing a second copy of the same folder
Publishing a folder that contains subfolders and images
Internet Archive
Publishing a record — unchanged path
Sorry, this record cannot be copied or published until processing completes.— not the new generic error.Info sidebar dates for folders ⭐
(no sidebar code changed — this is the surface the timestamp mapping newly reaches)
CreatedandLast modifiedvalues.UploadedandLast modifiedare unchanged from before — records already took this path.Folder rename and date edit
(folder edits round-trip through the same conversion)
Last modifiedreflects the edit you just made, rather than a stale or blank value.Folder thumbnails and lists in gallery
(same conversion, no timestamp involvement — regression only)
Unlisted share preview