Skip to content

Rename maxStringLength to largeStringThreshold (backward compat) - #2290

Merged
liz709 merged 1 commit into
masterfrom
liz/rename-maxStringLength-to-largeStringThreshold
Mar 31, 2026
Merged

Rename maxStringLength to largeStringThreshold (backward compat)#2290
liz709 merged 1 commit into
masterfrom
liz/rename-maxStringLength-to-largeStringThreshold

Conversation

@liz709

@liz709 liz709 commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Rename the maxStringLength config option in db.cloud.configure() to largeStringThreshold.

Why

The old name maxStringLength was misleading — it sounded like a hard limit on string length. In reality it is a threshold: strings longer than this value are offloaded to blob storage during sync. The new name largeStringThreshold clearly communicates that intent.

Changes

  • New preferred option name: largeStringThreshold
  • Old name maxStringLength still accepted (full backward compatibility) — logs a deprecation warning to console
  • largeStringThreshold takes precedence if both are set
  • Error messages updated to reference the new name

Migration

// Before (still works, but deprecated)
db.cloud.configure({ maxStringLength: 10000 })

// After
db.cloud.configure({ largeStringThreshold: 10000 })

Summary by CodeRabbit

  • Configuration
    • Renamed the configuration option maxStringLength to largeStringThreshold for more intuitive naming
    • maxStringLength remains fully supported for backward compatibility but is now deprecated. Users will receive a deprecation warning in the console when using the old option and should update their configuration to use largeStringThreshold

@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4533a1ae-1a9a-4ee7-95a5-922e5101ed38

📥 Commits

Reviewing files that changed from the base of the PR and between a308a2c and 0a5b51d.

📒 Files selected for processing (3)
  • addons/dexie-cloud/src/DexieCloudOptions.ts
  • addons/dexie-cloud/src/dexie-cloud-client.ts
  • addons/dexie-cloud/src/sync/sync.ts

📝 Walkthrough

Walkthrough

The PR deprecates the maxStringLength option in favor of largeStringThreshold across DexieCloud's configuration system. A new field is added to the interface, the old field is marked deprecated, and the configuration and sync logic are updated to validate and migrate the new option while preserving backward compatibility.

Changes

Cohort / File(s) Summary
Option Interface Update
addons/dexie-cloud/src/DexieCloudOptions.ts
Added largeStringThreshold property and marked maxStringLength as @deprecated in JSDoc.
Configuration Migration
addons/dexie-cloud/src/dexie-cloud-client.ts
Updated configure() to validate largeStringThreshold, emit deprecation warning for maxStringLength, and copy old value to new field when new is unset.
Sync Logic Update
addons/dexie-cloud/src/sync/sync.ts
Modified blob offloading threshold selection to prefer largeStringThreshold, with fallback to maxStringLength and default of 32768.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A string grows long, it seeks the cloud above,
With largeStringThreshold name of better love,
We bid farewell to maxStringLength past,
Yet keep it near—the old, it will outlast! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 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 summarizes the main change: renaming maxStringLength to largeStringThreshold while maintaining backward compatibility.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch liz/rename-maxStringLength-to-largeStringThreshold

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.

@liz709
liz709 merged commit 8df183b into master Mar 31, 2026
7 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.

1 participant