Skip to content

fix: bring back missing artworks from collection screen #12576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

MounirDhahri
Copy link
Member

@MounirDhahri MounirDhahri commented Aug 1, 2025

This PR resolves ONYX-1862

Description

This PR fixes an issue affecting artwork grids and leading to missing artworks. After some investigation, I believe this is affecting at least 4 other screens but potentially more

What went wrong

1. Initial Query
When a user initially opens an artwork screen we load 10 artworks
2. Second Query: Pagination
When the user reaches the end, we load 15 more artworks

The way relay does both 1 and 2 is by sending a query with first and cursor arguments .
Inside MP, we convert first and cursor to gravity supported arguments, meaning size, page and offset.

Let's break down both steps
1. Inital Query

  • We send to MP first: 10 then cursor:null - meaning the first 10 artworks
  • Based on the arguments we sent, we use convertConnectionArgsToGravityArgs giving us page:1 and size:10 and offset:0

Second QueryL Pagination

  • We send to MP first: 15 then cursor:last-artwork-cursor - meaning the next 15 artworks
  • Based on the arguments we sent, we use convertConnectionArgsToGravityArgs giving us page:2 and size:15 and offset:15. BUT, becaues offset is 15! we have skipped 5 artworks since offset is computed based on first.

Suggested solution
Align count on initial query and next queries like we always did before here #11745.

simulator_screenshot_BC216E3E-0003-4BF4-A59B-DDA9565698D9

PR Checklist

  • I have tested my changes on the following platforms:
    • Android.
    • iOS.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos at least on Android, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • fix bring back missing artworks from collection screen - mounir

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@MounirDhahri MounirDhahri self-assigned this Aug 1, 2025
@MounirDhahri MounirDhahri force-pushed the chore/fix-missing-artworks-from-collection-screen branch from 794994a to 91165f2 Compare August 1, 2025 09:37
@MounirDhahri MounirDhahri requested a review from iskounen August 1, 2025 09:38
@MounirDhahri MounirDhahri marked this pull request as ready for review August 1, 2025 09:38
@ArtsyOpenSource
Copy link
Contributor

This PR contains the following changes:

  • Cross-platform user-facing changes (fix bring back missing artworks from collection screen - mounir - MounirDhahri)

Generated by 🚫 dangerJS against 91165f2

@MounirDhahri MounirDhahri requested a review from gkartalis August 1, 2025 12:48
Copy link
Contributor

@iskounen iskounen left a comment

Choose a reason for hiding this comment

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

and offset:15

😱

Nice catch! Assuming that the artworks in these grids are sorted by merchandisability, we definitely want to be showing numbers 11 - 15 to users.

Copy link
Member

@MrSltun MrSltun left a comment

Choose a reason for hiding this comment

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

Nice catch! 🌟
@MounirDhahri Should we include this fix in the new release?

@MounirDhahri
Copy link
Member Author

@MrSltun yes, I discussed this with @evaschilken and we think it's a launch blocker and worth including in the release

@MounirDhahri MounirDhahri merged commit ecb6c6a into main Aug 4, 2025
8 checks passed
@MounirDhahri MounirDhahri deleted the chore/fix-missing-artworks-from-collection-screen branch August 4, 2025 10:20
MrSltun pushed a commit that referenced this pull request Aug 4, 2025
chore: remove missing artworks from collection screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants