Skip to content

Fix WebAssembly incompatible cast in download_logs_web.dart#459

Merged
Frezyx merged 2 commits into
masterfrom
copilot/fix-wasm-casting-issue
Jan 12, 2026
Merged

Fix WebAssembly incompatible cast in download_logs_web.dart#459
Frezyx merged 2 commits into
masterfrom
copilot/fix-wasm-casting-issue

Conversation

Copilot AI commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Thanks a lot for contributing!

Provide a description of your changes below

The downloadFile function was casting JSString to JSObject, which violates WebAssembly type safety rules and triggers invalid_runtime_check_with_js_interop_types lint error during flutter build web.

Changed:

// Before: invalid cast for WebAssembly
final jsArray = JSArray.from<JSString>(logs.toJS as JSObject);

// After: proper JS interop pattern
final jsArray = [logs.toJS].toJS;

The fix uses the standard dart:js_interop pattern where a Dart list containing the JSString is converted to JSArray<JSString> via .toJS extension, eliminating the incompatible cast.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/flutter_infra_release/flutter/1527ae0ec577a4ef50e65f6fefcfc1326707d9bf/dart-sdk-linux-x64.zip
    • Triggering command: /usr/bin/curl curl --retry 3 --continue-at - --location --output /tmp/flutter-sdk/bin/cache/dart-sdk-linux-x64.zip REDACTED cts/products_repository.dart cts/models/models.dart cts/models/product.dart cts/�� cts/abstarct_products_repository.dart bloc/bloc.dart (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Web Wasm - wrong casting</issue_title>
<issue_description>Describe the bug
I'm getting this incompatibility with WebAssembly:
/.pub-cache/hosted/pub.dev/talker_flutter-5.1.7/lib/src/utils/download_logs/download_logs_web.dart 6:42 - invalid_runtime_check_with_js_interop_types lint violation: Cast from 'JSString' to
'JSObject' casts a JS interop value to an incompatible JS interop type, which might not be platform-consistent. (10)

To Reproduce
flutter build web

Expected behavior
Works with WebAssembly
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Frezyx <40857927+Frezyx@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix wrong casting issue in WebAssembly Fix WebAssembly incompatible cast in download_logs_web.dart Dec 15, 2025
Copilot AI requested a review from Frezyx December 15, 2025 05:22
@Frezyx
Frezyx marked this pull request as ready for review December 29, 2025 08:12
@Frezyx
Frezyx merged commit 58e59d2 into master Jan 12, 2026
2 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.

Web Wasm - wrong casting

3 participants