Skip to content

Using uncommon file extensions for flutter-internal files risks customer web servers refusing to serve them #128456

@andrewkolos

Description

@andrewkolos

Background

Within the build output of any flutter app, there exists a unique file, the asset manifest (currently named AssetManifest.smcbin). This file contains metadata about assets that are available to the app at runtime. In particular, it provides the framework a cross-platform means to discover higher-resolution variants of image assets.

#122505 changed the extension and underlying format of the file. Before this, it was JSON (AssetManifest.json). This changed the file to be a serialized binary object (AssetManifest.bin, encoded using StandardMessageCodec). A follow-up hotfix changed the filename again to AssetManifest.smcbin, which is the current name as of writing.

Issue

Ideally, changing the extension (or any other aspect) of AssetManifest.smcbin should not impact customers, as this file is a framework-internal implementation detail. However, customers deploying flutter web apps have been impacted with vague, frustrating issues. Here are known examples, with some affecting several customers:

The main purpose of this issue is to document this (to be added as a code comment) and raise awareness of this issue, as it could be a problem for other features that rely on requesting files with uncommon extensions (hopefully none).

Takeaway questions: is there a way for us to improve this situation for customers? Is there some sort of way to, in the build output, hint to web servers that this file is safe to serve to clients? Can we make these type of issues easier to catch and debug? Is there some other , well-known, file extension we could use that would be safer (such as .bin, at the risk of reintroducing #124883).

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: assetsPackaging, accessing, or using assetsplatform-webWeb applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions