Skip to content

Commit

Permalink
fix: mutating ManyArray should handle duplicates gracefully (with dep…
Browse files Browse the repository at this point in the history
…recation) (#9198)

* Port typo fixes / notes

* Port snapshot-test cleanup

* Port embedded-records-mixin-test cleanup

* Port edge-removal helpers test fixes

Might need to revert some of these changes

* Attempt port of identifier-array changes

* Port many-array behavior

* Update docs tests

* Port expectDeprecation fix

* Fix lint:js

* Fix Tag import

* Revert assert.equal change

Shouldn't do this until this test is on diagnostic
  • Loading branch information
gitKrystan authored Jan 3, 2024
1 parent 23541f6 commit 039bc01
Show file tree
Hide file tree
Showing 18 changed files with 1,168 additions and 374 deletions.
2 changes: 1 addition & 1 deletion @types/ember-data-qunit-asserts/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ declare global {
}

interface Assert {
expectDeprecation(options: { id: string; count: number; until?: string }): void;
expectDeprecation(options: DeprecationConfig, label?: string): void;
expectDeprecation(callback: () => unknown, options: DeprecationConfig | string | RegExp): Promise<void>;
expectNoDeprecation(callback: () => unknown): Promise<void>;
expectWarning(callback: () => unknown, options: WarningConfig | string | RegExp): Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion ember-data-types/cache/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export interface Cache {
* An implementation might want to do this because
* de-referencing records which read from their own
* blob is generally safer because the record does
* not require retainining connections to the Store
* not require retaining connections to the Store
* and Cache to present data on a per-field basis.
*
* This generally takes the place of `getAttr` as
Expand Down
2 changes: 1 addition & 1 deletion packages/graph/src/-private/-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function diffCollection(

if (DEBUG) {
deprecate(
`Expected all entries in the relationship ${relationship.definition.type}:${relationship.definition.key} to be unique, see log for a list of duplicate entry indeces`,
`Expected all entries in the relationship ${relationship.definition.type}:${relationship.definition.key} to be unique, see log for a list of duplicate entry indices`,
false,
{
id: 'ember-data:deprecate-non-unique-relationship-entries',
Expand Down
2 changes: 1 addition & 1 deletion packages/json-api/src/-private/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export default class JSONAPICache implements Cache {
* An implementation might want to do this because
* de-referencing records which read from their own
* blob is generally safer because the record does
* not require retainining connections to the Store
* not require retaining connections to the Store
* and Cache to present data on a per-field basis.
*
* This generally takes the place of `getAttr` as
Expand Down
Loading

0 comments on commit 039bc01

Please sign in to comment.