Skip to content

Editing a pub internally breaks if related pub doesn't happen to be within the limit #1003

@allisonking

Description

@allisonking

What went wrong, step-by-step?

https://knowledgefutures.slack.com/archives/CMAQM0BNV/p1740674465642779

  1. Create a pub that has a related pub
  2. To reproduce this, you can probably change the limit here to something very small such that the pub that was related no longer is returned in the query https://github.com/pubpub/platform/blob/626e97e310537e74eeb8a77289514b7319d96d83/core/app/components/pubs/PubEditor/PubEditor.tsx#L166
  3. Loading the edit page for the pub will break because the app can't find the related pub

What did you expect to happen?

The app should be able to find the related pub.

What URL can we use to see the issue?

https://app.pubpub.org/c/arcadia/pubs/fb6347b2-ae79-4216-afdf-3dcc41906dca/edit

Add the "Pub Contributors" relation here and then the edit form will break

Possible solution

  1. if we have an existing pub, make sure to also pass that pub's related pubs to the context (maybe concatenate it here if possible?)
  2. the side menu that lets you add related pubs should query/paginate rather than just using the first 30 and stopping there

Just doing 1‍⃣ should fix the bug—would need 2‍⃣ to actually be able to associate any pub with another (and not just the first 30). If it's just 1‍⃣ then this is maybe a 1 point ticket, but if doing 2‍⃣ as well then it might be 2 or 3 points.

What browser/operating system were you using?

Optional

Have any screenshots? (Attach them by dragging the image here)

Who reported this? (If not you)

Metadata

Metadata

Assignees

Labels

1-daybugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions