Skip to content

Conversation

slifty
Copy link
Contributor

@slifty slifty commented Aug 26, 2025

This PR updates our getRecord call to use stela. This improvement is necessary to support unlisted share functionality, which only exists on stela.

This PR represents a modest refactor from the one opened at #630; the primary difference is that we re-package v2 results so that the object returned is the same type as before (e.g. a RecordResponse vs a RecordVO). This should prevent the need to refactor our components to have v1 and v2 versions as part of the unlisted shares improvements.

Related to #683

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch 2 times, most recently from a2dd303 to 481b56a Compare August 28, 2025 17:12
@slifty slifty mentioned this pull request Aug 28, 2025
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from 481b56a to 946ecd9 Compare August 28, 2025 17:25
@slifty slifty marked this pull request as ready for review August 28, 2025 17:25
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from 0548f17 to 819033a Compare August 28, 2025 18:08
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 63.33333% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.16%. Comparing base (27e2042) to head (685be13).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/app/shared/services/api/record.repo.ts 63.33% 6 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #669      +/-   ##
==========================================
+ Coverage   45.14%   45.16%   +0.02%     
==========================================
  Files         370      370              
  Lines       11256    11284      +28     
  Branches     1855     1860       +5     
==========================================
+ Hits         5081     5096      +15     
- Misses       6006     6012       +6     
- Partials      169      176       +7     

☔ View full report in Codecov by Sentry.
📢 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.

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from 819033a to bf2dc9d Compare August 28, 2025 18:15
Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

Very exciting! I was able to share a file and create a share link, and the site worked as expected, so it looks like this is working. Google Maps didn't load locally, but I suspect that's a local environment problem.

@slifty
Copy link
Contributor Author

slifty commented Aug 29, 2025

@cecilia-donnelly I'm doing some local QA and saw keywords acting funny -- going to go through with a fine-toothed-comb to see what similar "mocking" needs to be done to turn StelaRecords to RecordVos but overall the approach is still gonna be great

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch 3 times, most recently from a36a4c9 to 663a189 Compare September 3, 2025 16:18
@slifty
Copy link
Contributor Author

slifty commented Sep 3, 2025

@cecilia-donnelly ready for a re-review!

@slifty slifty changed the title Use v2 endpoints for get Use v2 / stela endpoints for getWithChildren and getRecord Sep 3, 2025
@slifty
Copy link
Contributor Author

slifty commented Sep 3, 2025

It looks like tests may be actually failing! Taking a look now.

@cecilia-donnelly cecilia-donnelly dismissed their stale review September 3, 2025 17:03

This needs to be reviewed/QA'd more deeply.

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from 46e9c89 to de8cd2f Compare September 3, 2025 17:29
@slifty
Copy link
Contributor Author

slifty commented Sep 3, 2025

Fixed the tests (I had to update the test fixture response to reflect stela return format).

I also fixed some leaking tests while I was in the area, and added that as another commit.

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from de8cd2f to c817b74 Compare September 3, 2025 17:31
@cecilia-donnelly cecilia-donnelly self-requested a review September 4, 2025 18:21
Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

We talked about this a little bit elsewhere, but to recap here:

  • Tags are not appearing specifically in the side/detail view on the file list (what you see when you single click an item in a workspace)

The other problems I saw resolved, so were likely related to queuing. I focused on QA-ing folder and record actions, so only lightly touched account, archive, and billing related aspects of the app. It's always possible that those are related in arcane ways, but seems less likely.

Here is my QA notes doc (sorry, not public): https://docs.google.com/document/d/1khJX_VNwCcES9dGHXDRwIsUXcnW06_uIuXi7L6oTrRM/edit?tab=t.0

@slifty
Copy link
Contributor Author

slifty commented Sep 9, 2025

I'll be adjusting this PR to use stela for both of these endpoints (rather than just record).

I'm also going to split each migration to a separate commit.

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from c817b74 to f524c53 Compare September 9, 2025 15:16
@slifty slifty changed the title Use v2 / stela endpoints for getWithChildren and getRecord Use stela endpoints for getWithChildren and getRecord Sep 9, 2025
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from f524c53 to b6caba4 Compare September 9, 2025 17:00
@slifty slifty changed the title Use stela endpoints for getWithChildren and getRecord Use stela endpoints for getRecord Sep 9, 2025
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from b6caba4 to bb2accf Compare September 12, 2025 14:21
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from 7c48e64 to 4424885 Compare September 12, 2025 18:11
Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

QA finding on dev: a subtle confusion in the custom metadata. We can look at this together, but here's what I see:

  1. On a record, open the side detail view with a single click
  2. Under "Custom Metadata," click the "Click to add" and add a "field:value" (e.g. color:orange)
  3. See that the metadata is populated (yay!) but only with the "value"
  4. Refresh the page
  5. Open the "Manage Custom Metadata" modal in Archive Settings (or from the detail sidebar)
  6. See that the fields and values are populated correctly (also yay)

So I think everything is working fine, but the display is not showing the "field" part of the "field:value" pair. This is true in both the detail sidebar and the full page view.

Let me know if this makes sense.

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from 4424885 to 10dd052 Compare September 12, 2025 20:08
@cecilia-donnelly
Copy link
Member

cecilia-donnelly commented Sep 12, 2025

Okay, another tiny thing but it feels like we're getting to the end of it!

  1. Click into the side detail view for a record
  2. Click into "custom metadata"
  3. Choose an existing field:value pair from the dropdown (I think this happens with new ones too though ETA: it does not)
  4. See that the metadata is applied and appears correctly, and that the dropdown stays open (as it should) and the selected metadata tag now shows up twice in that dropdown

The double tag persists through refresh but it (correctly) cannot be added to the record, so far as I can tell.

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from 10dd052 to c51157e Compare September 12, 2025 20:49
@slifty
Copy link
Contributor Author

slifty commented Sep 12, 2025

OK! I think that last bug was because stela returns tag id as a string, but PHP returns it as a number -- this means if there are interfaces that are combining some tags that were loaded by PHP endpoints + this record's tags it will treat them as two distinct tags!

Added a type cast so stela tag IDs are converted to numbers.

Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

Can confirm that the last problem I found is fixed!

Copy link
Member

@liam-lloyd liam-lloyd left a comment

Choose a reason for hiding this comment

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

I found a handful of IDs that are numbers here but strings in stela

@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch 2 times, most recently from 67f1542 to 43c79d1 Compare September 15, 2025 20:24
@slifty
Copy link
Contributor Author

slifty commented Sep 22, 2025

@slifty given that you gave this a pretty deep QA do you think could count as QA from a process PoV?

@cecilia-donnelly
Copy link
Member

cecilia-donnelly commented Sep 26, 2025

I went through my QA list again in full in @omnignorant's absence.

The only QA problem I have may or may not be related to these changes, but when trying to open a link to a public item, I am consistently redirected to the public gallery main page.

To reproduce:

  1. Log in to an archive with one or more public items.
  2. Select an item and click "Get Link" at the top menu.
  3. Choose "View on web" and notice that the app cycles indefinitely. Alternatively, copy the link and open it in a new tab. See that you are redirected to the public gallery main page.

This might just be a dev problem with redirection in general, but it is not happening on staging (or prod).

These are tests that were evaluating in a promise but there was no async
or `done`.  I did try making it async but that was causing failures, so
instead I'm just using `done` here and moving on with my life.
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from d47ad15 to d67a8f3 Compare September 30, 2025 17:57
@slifty
Copy link
Contributor Author

slifty commented Sep 30, 2025

Strange... Public urls works locally (I had tested it / had to make some fixes to support it) but not in dev.

I'm going to dig in more closely now to see what might be going on.

We are beginning to migrate our new feature development to stela,
which means we need to begin using those endpoints here. Eventually
we may go even further and use the permanent SDK, but for now what
we are doing is shimming stela's output to look as though it came from
the PHP api.

By mapping the stela type to the v1 type we avoid needing to refactor
all of our components. Eventually we would want to refactor these
components to use a more streamlined data type, but that is a larger
lift than we want for now.

Using stela endpoints will allow us to benefit from new authentication
methods (e.g. unlisted share tokens) in the near future.

Issue #683 Support unlisted shares

Co-authored-by: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com>
@slifty slifty force-pushed the PER-10107-use-record-get-v2 branch from d67a8f3 to 685be13 Compare September 30, 2025 18:17
@slifty
Copy link
Contributor Author

slifty commented Sep 30, 2025

Fixed up (the issue was that my Stela type didn't account for the fact that tags can be null.)

Time for a new round of QA! Going through the document.

Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

Thanks @slifty !

@slifty slifty merged commit 1e8adef into main Sep 30, 2025
12 checks passed
@slifty slifty deleted the PER-10107-use-record-get-v2 branch September 30, 2025 21:49
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.

4 participants