Skip to content

nested record duplicates #359

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

Closed
wants to merge 11 commits into from
Closed

Conversation

3h15
Copy link
Contributor

@3h15 3h15 commented Jul 9, 2025

Here is a commit about the missing linkage data. Turns out it's not related to my json_api_resources-like always_include_linkage implementation. It also happens when including deep nested relations.

I'm not sure about the fix though. It seems straightforward, but I wonder if it could lead to other side-effect problems, like different include paths producing multiple versions of the same record, with different preloaded data.

Also, I'm not sure if Enum.uniq is the way to go, or if it would be better to dedup on type + id only.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@zachdaniel
Copy link
Contributor

Yeah, I think the fix won't be able to be using Enum.uniq there, it will have to be "something else".

Could you pare this down just to a failing test? We can then explore solutions.

@3h15
Copy link
Contributor Author

3h15 commented Jul 10, 2025

Should we write more tests ?
I had to write this one because I needed a 3-level include to isolate the bug. But if we have to test every combination of relationships on 3 levels, that's going to be a lot.

@zachdaniel
Copy link
Contributor

It looks like the feature you're working on got added in? Main thing we want to start w/ is a test that fails proving the issue, and then we can explore what the cause is and how to avoid the issue w/o using Enum.uniq.

@3h15
Copy link
Contributor Author

3h15 commented Jul 10, 2025

Ooops. I probably rebased the branch, then forgot, then pushed the revert...

@3h15
Copy link
Contributor Author

3h15 commented Jul 10, 2025

I messed it up, sorry. I close this PR and open a clean one.

@3h15 3h15 closed this Jul 10, 2025
@3h15 3h15 deleted the includes-duplicates branch July 10, 2025 17:56
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.

2 participants