Skip to content

Conversation

@lukemelia
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Jan 22, 2026

Host Test Results

    1 files  ±0      1 suites  ±0   1h 44m 20s ⏱️ + 3m 55s
1 902 tests +4  1 885 ✅ +5  17 💤 ±0  0 ❌ ±0 
1 917 runs  +4  1 900 ✅ +6  17 💤 ±0  0 ❌  - 1 

Results for commit 574aab6. ± Comparison against base commit 49c53b3.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

Preview deployments

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves the handling of CardJson accept headers when non-card paths (plain files) are specified. The implementation moves from a centralized pre-routing check to per-handler checks, making the error handling more explicit and appropriate.

Changes:

  • Introduced a new nonJsonFileExists helper method to determine if a path refers to a non-JSON-backed file
  • Added specific checks in GET, PATCH, and DELETE handlers to reject CardJson requests for plain files with a 415 status
  • Consolidated and reorganized file URL tests for better clarity
  • Improved test adapter's exists method to not auto-create directories
  • Fixed test setup ordering to start Matrix after realm initialization

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/runtime-common/error.ts Added notAcceptable function to return 415 errors for unsupported media type requests
packages/runtime-common/realm.ts Removed centralized Accept header checks, added nonJsonFileExists helper, and integrated checks into GET/PATCH/DELETE handlers
packages/realm-server/tests/card-endpoints-test.ts Consolidated scattered file URL tests into a single module and updated test descriptions
packages/host/tests/helpers/index.gts Reordered test setup to start Matrix after realm initialization
packages/host/tests/helpers/adapter.ts Simplified exists method and added #traverseExisting to avoid auto-creating directories

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@habdelra
Copy link
Contributor

I noticed we got rid of the public writable tests--is that because that's an unrealistic scenario?

Comment on lines +825 to +827
if (startMatrix) {
await mockMatrixUtils.start();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

what was the reason for moving this? was it causing test flakiness?

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 think AI thought it would help. I doubt it matters one way or the other.

@lukemelia
Copy link
Contributor Author

I noticed we got rid of the public writable tests--is that because that's an unrealistic scenario?

The only thing in that module was a test for a non-card URL, and I reorganized to put all the non-card URLs together under one module.

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