Skip to content

Fix IsBinaryFile binary detection (#702)#716

Merged
ziagham merged 2 commits intoflowsynx:masterfrom
mohin-io:issue-702-fix-isbinary
Nov 16, 2025
Merged

Fix IsBinaryFile binary detection (#702)#716
ziagham merged 2 commits intoflowsynx:masterfrom
mohin-io:issue-702-fix-isbinary

Conversation

@mohin-io
Copy link
Copy Markdown
Contributor

Summary

  • tightens the IsBinaryFile heuristic using explicit printable ASCII checks, documents the converter extension, and avoids double enumeration
  • adds InternalsVisibleTo for FlowSynx.UnitTests so the helper can be validated without exposing it publicly
  • introduces focused unit tests covering text, binary, and null data scenarios so regressions are caught early

Closes #702

Testing

  • dotnet test tests/FlowSynx.UnitTests/FlowSynx.UnitTests.csproj (fails: local environment only has the .NET 8 SDK while the solution targets net9.0)

@mohin-io mohin-io requested review from a team as code owners November 13, 2025 22:24
Copy link
Copy Markdown
Member

@ziagham ziagham left a comment

Choose a reason for hiding this comment

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

Thank you for the clean refactoring of the IsBinaryFile method. However, please remove the unit test since it’s in the wrong project and location, and also remove the ProjectReferences from FlowSynx.UnitTests.csproj. In addition, please delete the unnecessary AssemblyInfo.cs file, as it shouldn’t be included—this isn’t the proper way to expose an internal class.

I will create a separate issue for adding unit tests for the LocalFileSystem plugin. For now, please commit only the changes related to IsBinaryFile and delete everything else.

@mohin-io
Copy link
Copy Markdown
Contributor Author

Thanks @ziagham for pointing that out. I've removed the misplaced ConverterExtensions tests, dropped the FlowSynx.UnitTests project references, and deleted the Properties/AssemblyInfo.cs file so the PR now only includes the IsBinaryFile refactor. Let me know if anything else needs to change.

@ziagham
Copy link
Copy Markdown
Member

ziagham commented Nov 15, 2025

@mohin-io Could you please check whether you committed your changes? The code still looks the same as before, and the latest commit is from two days ago.

@sonarqubecloud
Copy link
Copy Markdown

@mohin-io
Copy link
Copy Markdown
Contributor Author

Hi @ziagham, I just pushed commit 5dfcabc to issue-702-fix-isbinary; it removes the misplaced ConverterExtensions tests, drops the LocalFileSystem project reference from FlowSynx.UnitTests.csproj, and deletes the temporary AssemblyInfo.cs, so the PR now only contains the IsBinaryFile refactor. Please check the latest commit and let me know if anything else looks off from my side

Copy link
Copy Markdown
Member

@ziagham ziagham left a comment

Choose a reason for hiding this comment

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

Thanks so much.

@ziagham ziagham merged commit d5d67e5 into flowsynx:master Nov 16, 2025
4 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.

Bug: IsBinaryFile condition always evaluates to true

2 participants