Repository navigation
Import the OpenDocument MIME constants from where they are exported - #9520
Merged
Merged
Conversation
attachment-content.ts imported OPEN_DOCUMENT_SPREADSHEET_MIME and OPEN_DOCUMENT_TEXT_MIME from ./open-document, which exports neither. Both are declared in ./open-document-accept; open-document.ts only imports the first of them from there, so the name existed locally without being re-exported. TS2459 and TS2305, so the frontend build fails on main and on every open pull request that merges it. #9455 and #8655 landed minutes apart. Each was consistent on its own branch and neither could see the other.
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.
studio/frontend/src/features/chat/attachment-content.tsimportsOPEN_DOCUMENT_SPREADSHEET_MIMEandOPEN_DOCUMENT_TEXT_MIMEfrom./open-document, which exports neither. Both are declared in./open-document-accept, andopen-document.tsonly imports the first of them from there, so the name exists locally without being re-exported.The frontend build fails on main, and on every open pull request, since each one builds main merged with itself.
How it got here
#9455 and #8655 landed minutes apart. #8655 added the two consumers in
attachment-content.ts; #9455 moved the constants intoopen-document-accept.ts. Each branch was internally consistent and neither could see the other, so both were green when they merged and the tree they produced together is not.The fix
Take the two MIME constants from the module that exports them, and leave the byte limits and the reader on
./open-document.Deliberately not a re-export from
open-document.ts. That would keep the import site looking correct while leaving one module the apparent owner of constants declared in another, which is the ambiguity that allowed this in the first place.Checks
tsc --noEmit -p tsconfig.app.jsonclean, RC 0, against TS2459 and TS2305 before the change. Frontend suite 4391 passed, 0 failed. No behaviour change: the values are identical objects from the same declaration site.