fix(xlsx): persist CSV and TSV imports - #333
Open
kriptoburak wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #316.
Problem
importchanges the worksheet and marks it dirty, but it never marks the handler modified. Editable spreadsheet sessions now use an in-memory package for atomic saves.Dispose()therefore follows its byte-preserving read-only path and discards the imported cells. The command reports success while the workbook stays empty.Fix
Mark a validated, non-empty import as a mutation before writing its first row. Disposal then flushes the dirty worksheet and atomically writes the package back. Empty input and dimension-validation failures remain non-mutating.
Validation
I reproduced the failure with v1.0.144 on macOS arm64. The command reported
Imported 2 rows x 3 cols, whileview,dump, andxl/worksheets/sheet1.xmlcontained no cells.I built this branch with zero warnings:
Then I tested both documented input paths. The sample matches a real Xquik extraction CSV, including its UTF-8 BOM and export headers.
The fixed build persists the expected cells:
The saved worksheet XML now contains both rows plus
autoFilter ref="A1:C2"and the frozen pane atA2.