Skip to content
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

fix: mutating ManyArray should handle duplicates gracefully (with deprecation) #9198

Merged
merged 11 commits into from
Jan 3, 2024

Conversation

gitKrystan
Copy link
Contributor

@gitKrystan gitKrystan commented Jan 3, 2024

Description

Port of #9126 and #9189 (see #9119)

Re-enables deduplication of duplicate records added to ManyArrays, but with a deprecation (ember-data:deprecate-many-array-duplicates) as described below:

/**
 * **id: ember-data:deprecate-many-array-duplicates**
 *
 * When the flag is `true` (default), adding duplicate records to a `ManyArray`
 * is deprecated in non-production environments. In production environments,
 * duplicate records added to a `ManyArray` will be deduped and no error will
 * be thrown.
 *
 * When the flag is `false`, an error will be thrown when duplicates are added.
 *
 * @property DEPRECATE_MANY_ARRAY_DUPLICATES
 * @since 5.3
 * @until 6.0
 * @public
 */

Notes for the release

@gitKrystan gitKrystan changed the base branch from main to lts January 3, 2024 18:26
@gitKrystan gitKrystan changed the base branch from lts to main January 3, 2024 18:27
@gitKrystan gitKrystan changed the base branch from main to release January 3, 2024 19:00
@gitKrystan gitKrystan added 🏷️ bug This PR primarily fixes a reported issue backport-release PR targets the current release branch 🎯 release PR should be backported to release 🏷️ deprecation and removed 🎯 release PR should be backported to release labels Jan 3, 2024
chris.bestFriends = john;
}
}

await settled();
// give ourselves a tick in case there was async work
await Promise.resolve();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change came from copy-pasta. Should I keep it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be fine

Shouldn't do this until this test is on diagnostic
@runspired runspired merged commit 039bc01 into release Jan 3, 2024
8 checks passed
@runspired runspired deleted the port-9126-5-3 branch January 3, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-release PR targets the current release branch 🏷️ bug This PR primarily fixes a reported issue 🏷️ deprecation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants