Skip to content

fix: send empty file content to compiler instead of reading stale con…#520

Merged
magnus-madsen merged 1 commit into
flix:masterfrom
Sejder:master
Feb 23, 2026
Merged

fix: send empty file content to compiler instead of reading stale con…#520
magnus-madsen merged 1 commit into
flix:masterfrom
Sejder:master

Conversation

@Sejder
Copy link
Copy Markdown
Contributor

@Sejder Sejder commented Feb 23, 2026

…tent from disk

When a file is cleared (select all + delete), job.src is "" (empty string). Using !job.src treated empty string as falsy, causing the queue to read stale content from disk instead of sending the empty string to the compiler. Changed to job.src == null to only fall back to disk when src is truly absent.

I got claude code to look into this issue and it came up with this solution.

…tent from disk

When a file is cleared (select all + delete), job.src is "" (empty string).
Using !job.src treated empty string as falsy, causing the queue to read
stale content from disk instead of sending the empty string to the compiler.
Changed to job.src == null to only fall back to disk when src is truly absent.
@magnus-madsen
Copy link
Copy Markdown
Member

That's an amazing find. Do we want to use === null instead of == null?

@magnus-madsen magnus-madsen merged commit 1f0c332 into flix:master Feb 23, 2026
8 of 11 checks passed
@Sejder
Copy link
Copy Markdown
Contributor Author

Sejder commented Feb 23, 2026

i think not. == checks both null and undefined, otherwise we would have to check both job.src === null ||job.src === undefined

@magnus-madsen
Copy link
Copy Markdown
Member

Pushed-- should be in the ecosystem in 30min

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