Skip to content

fix(validator): drop the stray quote from the index length message - #1035

Merged
abnegate merged 1 commit into
mainfrom
fix/index-length-message
Oct 16, 2026
Merged

abnegate merged 1 commit into
mainfrom
fix/index-length-message

Conversation

@abnegate

@abnegate abnegate commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

What

IndexDefinition rejected an index length larger than its attribute's size with a trailing ":

Index length 65 is larger than the size for title: 64"

Appwrite passes this message to API callers unchanged. Staging QA reported it from POST /v1/tablesdb/{db}/tables/{t}/indexes with lengths: [65] on a 64-character column.

Fix

Remove the trailing .'"'. The two adapter E2E assertions in IndexTests that encoded the stray quote now expect the clean message.

Tests

Test main this PR
unit Validator/IndexTest::testIndexLengthLargerThanTheAttributeNamesBothSizes ❌ …title: 64" ✅ …title: 64
e2e Adapter/Scopes/IndexTests (two assertions on title1: 700) expected the quote updated
Appwrite API E2E testIndexLengthPastTheFieldSizeNamesBothSizes (TablesDB and Legacy, run with this fix copied into vendor) ❌ …title: 64" ✅

tests/unit/Validator passes in full (1042 tests). The Appwrite E2E is on branch qfix-index-length-e2e in appwrite/appwrite and lands with the release that includes this fix.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the oversized index length error message by removing an unintended trailing quotation mark.
    • Improved validation coverage for index lengths that exceed an attribute’s allowed size; the validation behavior remains unchanged.

An index length larger than its attribute's size was refused with
"Index length 65 is larger than the size for title: 64"", the trailing
quote a leftover of a removed opening one. Appwrite shows the message to
API callers as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: utopia-php/database/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9c42e23-577f-48cd-908d-51440bb31c28
📥 Commits

Reviewing files that changed from the base of the PR and between 7154053 and f6e975a.

📒 Files selected for processing: 3
  • src/Database/Validator/IndexDefinition.php
  • tests/e2e/Adapter/Scopes/IndexTests.php
  • tests/unit/Validator/IndexTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The oversized-index-length validation message no longer has a trailing double quote. Tests expect the corrected message, and a unit test verifies that validation reports both the requested index length and the attribute size.

Changes: Index validation

Layer / File(s) Summary
Correct validation message and test coverage
src/Database/Validator/IndexDefinition.php, tests/unit/Validator/IndexTest.php, tests/e2e/Adapter/Scopes/IndexTests.php
The validation message no longer ends with a double quote. Tests check the corrected message and verify that an oversized index length error reports both lengths.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: fogelito

Merge Risk: ⚪ Minimal · up to f6e97

The validation message and its test expectations are aligned; the described change presents no material merge risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: removing the stray trailing quote from the validator index-length error message.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@abnegate
abnegate merged commit 5221d4f into main Oct 16, 2026
24 checks passed
@abnegate
abnegate deleted the fix/index-length-message branch October 16, 2026 10:44
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.

1 participant