Skip to content

Add last_known_good_deps so error state cards have prerendered CSS#3942

Merged
backspace merged 12 commits intomainfrom
last-known-good-deps-cs-10146
Feb 10, 2026
Merged

Add last_known_good_deps so error state cards have prerendered CSS#3942
backspace merged 12 commits intomainfrom
last-known-good-deps-cs-10146

Conversation

@backspace
Copy link
Contributor

@backspace backspace commented Feb 3, 2026

The staging card that has a Checkly check for scoped CSS has been mysteriously spontaneously breaking. The card prerenders in host mode but not its scoped CSS (the text should be pink):

e8c0a21ef0e0f5101a0d9e590435203ca7bf96af 2026-02-09 11-14-27 boxel-staging static site custombuck stack cards html | Check session 2026-02-09 11-44-53

This is because boxel_index.deps is the source for scoped CSS and it’s truncated when the card has an error. This PR adds a new boxel_index.last_known_good_deps that preserves a fallback in case a new version of a card has an error but a prior one worked.

It’s an open question what host should do when taking over if a card is in an error state. If this PR is merged it would look like this, but it probably makes sense to detect the error state and act differently:
e8c0a21ef0e0f5101a0d9e590435203ca7bf96af 2026-02-09 11-53-02

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Host Test Results

    1 files  ± 0      1 suites  ±0   1h 48m 19s ⏱️ + 5m 12s
1 949 tests +70  1 932 ✅ +69  17 💤 +1  0 ❌ ±0 
1 964 runs  +71  1 947 ✅ +70  17 💤 +1  0 ❌ ±0 

Results for commit e366d77. ± Comparison against base commit 7ce0417.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Preview deployments

backspace and others added 8 commits February 3, 2026 12:51
The test was timing out because breaking a module alone doesn't
automatically trigger re-indexing of dependent instances. Adding
a PATCH request to the instance forces it to re-index and encounter
the broken module, causing it to enter an error state as expected.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The BoxelIndexTable type now requires the last_known_good_deps field,
so test assertions comparing against this type need to include it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PATCH validates the card against the module, which fails when the
module is broken. Using a raw JSON write via POST with
application/vnd.card+source bypasses validation and triggers
re-indexing, which then encounters the broken module.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Instead of breaking the module and hoping the error propagates to
the instance, make the instance reference a non-existent module.
This directly causes the instance to fail indexing and is more
reliable than relying on module dependency propagation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
created_at NOT NULL,
PRIMARY KEY ( id )
);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’m confused by the presence of this, maybe updating the schema was missed in another PR?

Copy link
Contributor

@tintinthong tintinthong Feb 11, 2026

Choose a reason for hiding this comment

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

I confirm that these additions for bot_registrations are correct but it had already been covered in the other schema.sql file.

schema/1770616671686_schema.sql

Currently, inside main there are 2 of these files however this file you just changed doesn't include bot_commands so I'm leaning towards deleting this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

boxel 2026-02-10 20-51-43

Mine didn’t include it because it didn’t exist when I submitted this for review. I think we need a better system here.

@backspace backspace marked this pull request as ready for review February 9, 2026 17:54
@backspace backspace requested a review from a team February 9, 2026 17:54
Comment on lines +4 to +10
CREATE TABLE IF NOT EXISTS bot_registrations (
id NOT NULL,
username TEXT NOT NULL,
created_at NOT NULL,
PRIMARY KEY ( id )
);

Copy link
Contributor

Choose a reason for hiding this comment

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

@tintinthong can you confirm what's up here?

@backspace backspace merged commit f6e615a into main Feb 10, 2026
169 of 172 checks passed
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.

3 participants