Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@ferhatb
Copy link
Contributor

@ferhatb ferhatb commented Apr 15, 2021

When server returns html doc for asset request, instead of failing asset load, the engine was detecting failure much later during decoding.

This PR:

  • Detects invalid html response and properly returns asset failure.
  • logs a warning to console for failure in release mode.
  • Adds integration test.

flutter/flutter#74935

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the [engine presubmit flakes form] before re-triggering the failure.

@ferhatb ferhatb requested a review from harryterkelsen April 15, 2021 00:15
@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Apr 15, 2021
@google-cla google-cla bot added the cla: yes label Apr 15, 2021
@ferhatb ferhatb requested a review from mdebbar April 23, 2021 16:57
const MethodCodec codec = JSONMethodCodec();
final String message = 'Error while trying to load an asset $url';
if (!assertionsEnabled) {
/// For web/release mode log the load failure on console.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this necessary? Shouldn't the _replyToPlatformMessage(...) call below be enough to log the failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is this necessary? Shouldn't the _replyToPlatformMessage(...) call below be enough to log the failure?

Otherwise for release builds user gets no indication of failure at all. The error reported by replyToPlatformMessage is silent in release mode.

Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

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

LGTM with nit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants