Skip to content

Conversation

@ahmednfwela
Copy link
Collaborator

@ahmednfwela ahmednfwela commented Oct 16, 2025

Pull Request

Related issue

Fixes #450

What does this PR do?

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

Summary by CodeRabbit

  • Tests

    • Improved type safety when verifying JWT token payloads in the test suite.
  • Chores

    • Updated development lint dependency constraint to the 6.x release line for dev tooling consistency.

@ahmednfwela ahmednfwela requested a review from curquiza October 16, 2025 20:01
@coderabbitai
Copy link

coderabbitai bot commented Oct 16, 2025

Walkthrough

JWT payload in tests is now explicitly cast to Map<String, Object?> for type-safe claims access; dev dependency lints constraint in pubspec.yaml was changed to ^6.0.0.

Changes

Cohort / File(s) Summary
Test: JWT payload cast
test/tenant_token_test.dart
Cast JWT.verify(...).payload to Map<String, Object?> so claims['...'] bracket access is type-safe. No logic changes.
Dev dependency update
pubspec.yaml
Updated dev_dependency lints constraint from ">=2.1.0 <7.0.0" to ^6.0.0. No code changes.

Sequence Diagram(s)

(omitted — changes are small and do not alter control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny cast hops into place,
Claims find their keys with gentle grace,
A lint line tuned, a test that sings,
Quiet fixes, hopeful springs. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The PR contains an out-of-scope change in pubspec.yaml that updates the lints dev_dependency constraint from ">=2.1.0 <7.0.0" to "^6.0.0". This dependency change is unrelated to the primary objective of fixing the JWT type casting issue described in linked issue #450, which is about addressing a breaking change in the dart_jsonwebtoken library, not the lints package. The lints update appears to have been introduced without justification and is not mentioned in or required by the linked issue. Remove the pubspec.yaml change to lints dependency constraints, or provide clear justification for why this dependency update is necessary to resolve issue #450. The core fix (JWT payload type casting in the test file) should be sufficient to resolve the CI failure without modifying unrelated dev dependencies.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues Check ✅ Passed The PR successfully addresses the primary coding requirement from linked issue #450. The core objective was to fix the type casting issue in JWT claims handling that caused the CI failure, where the operator '[]' was not defined for the type 'Object'. The PR resolves this by explicitly casting the JWT payload to Map<String, Object?>, which enables the dictionary access operations (claims['apiKeyUid'], claims['searchRules']) that were previously failing. This directly resolves the compiler errors reported in issue #450.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The pull request title "fix: type casting for JWT claims in tenant token tests" accurately describes the primary change in the changeset. The main objective is to fix a breaking change in JWT handling by adding type casting for claims in the test file, which directly addresses the CI failure described in issue #450 where the operator '[]' was not defined for type 'Object'. The title is clear, specific, and concise, providing a meaningful summary of the core fix. While the changeset also includes a secondary dependency constraint update in pubspec.yaml, the title appropriately focuses on the main functional fix without requiring exhaustive coverage of every detail.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/failing-tests-jwt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

bors merge

@curquiza curquiza added the bug Something isn't working label Oct 22, 2025
@curquiza curquiza changed the title fix: type casting for JWT claims in tenant token tests Type casting for JWT claims in tenant token tests Oct 22, 2025
@meili-bors
Copy link
Contributor

meili-bors bot commented Oct 22, 2025

Build succeeded:

@meili-bors meili-bors bot merged commit a3bb5f3 into main Oct 22, 2025
7 checks passed
@meili-bors meili-bors bot deleted the fix/failing-tests-jwt branch October 22, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI failing suddendly on main

3 participants