-
Notifications
You must be signed in to change notification settings - Fork 12
Stop building an index serialization's link graph in order to discard it #6173
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
Changes from all commits
b653c20
23679cc
d639a0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -346,6 +346,54 @@ module('Acceptance | prerender | meta', function (hooks) { | |
| ); | ||
| }); | ||
|
|
||
| test('a serialized instance stops at its own resource, however deep the resident graph', async function (assert) { | ||
| // Jade links to Hassan, who links to three pets. The searchable settle | ||
| // leaves that whole graph resident, so this is the case where walking it | ||
| // would cost the most and contribute the least: a link target is a | ||
| // reference here, and its own links are not the card's to carry. | ||
| let url = `${testRealmURL}Person/jade.json`; | ||
| await visit(renderPath(url, '/meta')); | ||
|
Comment on lines
+350
to
+355
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Claude Code 🤖] "The searchable settle leaves that whole graph resident" is the only thing that makes this a two-level case, and it isn't the searchable walk that delivers it — that walk never reaches the pets.
What pulls the pets in is Since the assertion can't distinguish the scopes on its own, residency is the whole of what makes it a guard. This file already has the idiom for establishing it deliberately — Non-blocking; the gap is in the test's coverage claim, not in the change. Generated by Claude Code |
||
| let { value } = await capturePrerenderResult('textContent'); | ||
| let meta: PrerenderMeta = JSON.parse(value); | ||
| assert.deepEqual( | ||
| meta.serialized, | ||
| { | ||
| data: { | ||
| type: 'card', | ||
| id: testRRI('Person/jade'), | ||
| attributes: { | ||
| name: 'Jade', | ||
| cardTitle: 'Jade', | ||
| cardInfo: { | ||
| name: null, | ||
| summary: null, | ||
| cardThumbnailURL: null, | ||
| notes: null, | ||
| }, | ||
| cardDescription: null, | ||
| cardThumbnailURL: null, | ||
| numOfPets: '0', | ||
| }, | ||
| relationships: { | ||
| friend: { | ||
| links: { | ||
| self: './hassan', | ||
| }, | ||
| }, | ||
| }, | ||
| meta: { | ||
| adoptsFrom: { | ||
| module: rri('../person'), | ||
| name: 'Person', | ||
| }, | ||
| realmURL: testRealmURL, | ||
| }, | ||
| }, | ||
| }, | ||
| 'the link target is a reference, and neither it nor its own links ride along', | ||
| ); | ||
| }); | ||
|
|
||
| test('can generate display name', async function (assert) { | ||
| let url = `${testRealmURL}Pet/paper.json`; | ||
| await visit(renderPath(url, '/meta')); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Claude Code 🤖] "at any wider scope" overstates it — only
'all'takes that walk.isExcludedByIncludedScopeincard-api.gtsreadsvalue.id ? includedScope !== 'all' : includedScope === 'none', so a target with anidis excluded under every scope but'all', and on this path every resident target is saved.'local'here would serialize exactly what'none'does.As written the paragraph tells the next reader that
'local'is dangerous on this path too, which is the opposite of the write path's reasoning incard-service.ts. "at the default'all'scope" covers it.Non-blocking; comment accuracy.
Generated by Claude Code