Skip to content

feat: export 64-bit file_size_bigint at publish#6041

Merged
rtibbles merged 3 commits into
learningequality:hotfixesfrom
rtibblesbot:issue-5987-e45197
Jul 13, 2026
Merged

feat: export 64-bit file_size_bigint at publish#6041
rtibbles merged 3 commits into
learningequality:hotfixesfrom
rtibblesbot:issue-5987-e45197

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Channels containing a file larger than 2.1 GB export with a wrong or missing size, because publish writes each file's size only into the legacy 32-bit LocalFile.file_size column, which cannot represent it. Publish now also writes a 64-bit LocalFile.file_size_bigint carrying the true size, and clamps the legacy 32-bit file_size (on both LocalFile and File) to NULL when the size overflows. Current Kolibri reads the real size from the bigint column; older Kolibri keeps reading the legacy column and simply sees NULL for those oversized files. No content-schema version bump — VERSION_6 is already advertised.

References

Closes #5987. Ships with #6040 (included_presets) in the same VERSION_6 hotfix. Kolibri reader: learningequality/kolibri#14881. Studio-side bigint storage: #5974.

Reviewer guidance

  • contentcuration/contentcuration/utils/publish.py:67 — this change deliberately adds no version bump; confirm the content-schema VERSION stays 6 and MIN_SCHEMA_VERSION stays "1" so pre-VERSION_6 Kolibri still imports these databases.
  • contentcuration/contentcuration/utils/publish.py:704File.file_size now takes the clamped legacy_size; confirm the File.file_size == LocalFile.file_size invariant still holds for oversized files (both NULL).
  • contentcuration/kolibri_content/migrations/0025_localfile_file_size_bigint.py and contentcuration/kolibri_public/migrations/0010_localfile_file_size_bigint.py — confirm both mirrors migrate the column and chain off the merged included_presets migrations.

AI usage

Used Claude Code to implement this against a pre-approved plan, following the sibling included_presets export (#6040) for the migration and publish patterns. Verified with the test_exportchannel suite, including two new tests covering the ≤2.1 GB (both columns match) and >2.1 GB (bigint real, legacy NULL) cases and the existing file_size invariant regression.


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks
@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-07-13 01:37 UTC

rtibblesbot and others added 3 commits July 12, 2026 18:14
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rtibblesbot rtibblesbot marked this pull request as ready for review July 13, 2026 01:37

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes as expected.

@rtibbles rtibbles merged commit 936dc23 into learningequality:hotfixes Jul 13, 2026
29 checks passed
@rtibblesbot rtibblesbot deleted the issue-5987-e45197 branch July 13, 2026 03:13
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.

2 participants