Skip to content

[PER-10679] Replace navigateLean with getWithChildren in the publish functionality - #1135

Open
aasandei-vsp wants to merge 1 commit into
PER-10476-replace-navigate-minfrom
PER-10679-replace-navigate-lean-publish
Open

[PER-10679] Replace navigateLean with getWithChildren in the publish functionality#1135
aasandei-vsp wants to merge 1 commit into
PER-10476-replace-navigate-minfrom
PER-10679-replace-navigate-lean-publish

Conversation

@aasandei-vsp

@aasandei-vsp aasandei-vsp commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

  1. Right-click a folder that has never been published and choose Publish.
    • EXPECTED: A spinner, then a public link. No error toast.
  2. Copy the link and open it in a new tab.
    • EXPECTED: The published copy of that folder loads, with its contents.
  3. Check the link text itself.
    • EXPECTED: It contains a real archive number and folder link id — no undefined, no NaN, no empty segment between slashes. The archive segment should end in -0000.
  4. Click View on the web in the dialog.
    • EXPECTED: It navigates to the published folder, the same place the copied link went. This is a different code path from the link text, so check both.
  5. Open the Public area from the left menu.
    • EXPECTED: The published copy is there, with the same name as the source folder.

Publishing a second copy of the same folder

  1. Publish the same folder again.
    • EXPECTED: A link comes back, pointing at the newest copy rather than the one from the first publish. This is the case that depends on the timestamp mapping — without it the dialog would pick an arbitrary copy or none at all.
  2. Open the Public area.
    • EXPECTED: Two copies exist, and the link from step 1 opens the more recent one.

Publishing a folder that contains subfolders and images

  1. Publish a folder holding both subfolders and image records.
    • EXPECTED: A link comes back within a few seconds.
  2. Open the link.
    • EXPECTED: Subfolders and images are all present, thumbnails included.

Internet Archive

  1. With a folder published, use the Internet Archive action in the same dialog.
    • EXPECTED: The request is accepted. No error about a missing item.

Publishing a record — unchanged path

  1. Publish a single record (not a folder).
    • EXPECTED: A public link comes back and opens the record.
  2. Publish a record that is still processing, if you can catch one.(I couldn't catch one, maybe a bigger file?)
    • EXPECTED: The specific message 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)

  1. Before building this branch on dev, select a folder in the file list, open the info sidebar and write down its Created and Last modified values.
    • EXPECTED: Two dates, in whatever format the app shows today.
  2. On this branch build on dev, select the same folder and compare.
    • EXPECTED: The same two dates. Watch for three specific things: a value shifting by hours or a day, a time appearing where there used to be only a date, and a row going blank.
  3. Select a folder, wait about ten seconds without clicking anything, then look again.
    • EXPECTED: The dates do not change while you watch. The background refresh overwrites folder rows a few seconds after load, so this is where a mismatch between the two sources would surface.
  4. Select a record instead.
    • EXPECTED: Uploaded and Last modified are unchanged from before — records already took this path.
  5. Select a folder in the Shares workspace, and one in the Public area.
    • EXPECTED: Both show dates, with no blanks and no errors.

Folder rename and date edit

(folder edits round-trip through the same conversion)

  1. Rename a folder from the file list and wait for the save to finish.
    • EXPECTED: The new name shows on the row.
  2. Select the renamed folder and check the sidebar.
    • EXPECTED: Last modified reflects 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)

  1. Open a folder in the gallery containing several subfolders that each hold different images.
    • EXPECTED: Each folder tile shows a thumbnail from its own contents. No two folders sharing an image, no permanently blank tiles.

Unlisted share preview

  1. Open an unlisted share link to a folder while logged out.
    • EXPECTED: The folder and its contents render, with thumbnails.
  2. Navigate into a subfolder and back out.
    • EXPECTED: Both levels show the right contents.

@aasandei-vsp
aasandei-vsp force-pushed the PER-10476-replace-navigate-min branch from bf77982 to 72c4bfc Compare August 12, 2026 08:51
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.83%. Comparing base (25f05ef) to head (476f085).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           PER-10476-replace-navigate-min    #1135      +/-   ##
==================================================================
+ Coverage                           52.67%   52.83%   +0.16%     
==================================================================
  Files                                 355      355              
  Lines                               12153    12154       +1     
  Branches                             2206     2206              
==================================================================
+ Hits                                 6401     6422      +21     
+ Misses                               5524     5504      -20     
  Partials                              228      228              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/updatedAt onto FolderVO.createdDT/updatedDT for folders (including child folders).
  • Replace navigateLean(publicRoot) with getWithChildren([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 latest as 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 newer updatedDT than 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.

@@ -95,6 +125,10 @@ describe('PublishComponent', () => {
});

it('should disaple the public to internet archive button if the user does not have the correct access role', () => {

@slifty slifty 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.

Two very very tiny points -- approving since they are really just cosmetic!

import { Observable } from 'rxjs';
import { MessageService } from '@shared/services/message/message.service';
import { EventService } from '@shared/services/event/event.service';
import { GoogleAnalyticsService } from '@shared/services/google-analytics/google-analytics.service';

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.

Is this related to the migration to getWithChildren or was it a "we found this issue while here" addition?

If the latter, let's make it a separate commit.

}),
refreshAccountDebounced: () => {},
};
const PUBLIC_ROOT = new FolderVO({

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.

Is this object magical / meaningful / must have these specific values?

If not, let's call this MOCK_PUBLIC_ROOT to make it clear that these are mocked values, and maybe even have the folderId clearly mocked (e.g. 123456) so that there's no confusion.

@aasandei-vsp
aasandei-vsp force-pushed the PER-10476-replace-navigate-min branch 2 times, most recently from 50d2476 to 25f05ef Compare August 21, 2026 10:55
@aasandei-vsp
aasandei-vsp force-pushed the PER-10679-replace-navigate-lean-publish branch 2 times, most recently from 01eddfb to f22d6d7 Compare August 21, 2026 11:30
@aasandei-vsp aasandei-vsp self-assigned this Aug 21, 2026
@aasandei-vsp aasandei-vsp added the QA This issue is ready for QA / user acceptance testing label Aug 21, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA This issue is ready for QA / user acceptance testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants