Skip to content

Extension reload breaks waitForExtension #25436

@jpettitt

Description

@jpettitt

When an extension depends on another extension for a service it ends up in waitForExtension if the provider hasn't yet loaded. We've been seeing timeouts from waitForExtension that shouldn't be happening.

This problem is that if v0.js detects a version mismatch (v0.js version differs from an extension version) it automatically loaded the correct version of the extension to match v0 9getExtensionScript_). When it does this it creates a new extension holder which leaves waitForExtension waiting on a load that will never happen.

This only happens on publisher sites due to the AMP cache automatically syncing versions and it only happens if the extension in cache mismatches v0.js.

See deletion of the extension holder https://github.com/ampproject/amphtml/blame/40fa29d8daacd92fbbcfda825f4b7f89dab25a34/src/service/extensions-impl.js#L255

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions