Skip to content

Conversation

@mraerino
Copy link
Contributor

@mraerino mraerino commented Jun 7, 2018

Resolves

Is connected to #31 but I did not create an issue for this particular change.

Proposed Changes

Whenever an assetUrl returns false the WebHelper tries the next source.

Reason for Changes

If there are multiple web sources, the url function may want to indicate whether the current asset is available in its source, based on the asset. While sources are already filtered by asset type, there may be different properties that determine if a source is applicable.
In our case, we use a special prefix on some projects to indicate a special source (like a special S3 location). The source will always be the first source, so we can be sure the prefixed projects are always loaded from the right source. But if the prefix is missing the url function should be able to indicate a skip by returning false. Throwing an error is not handled and results in a failure of the app.

Test Coverage

Will add, if wanted.

If there are multiple web sources, the url function may want to indicate
whether the current asset is available in its source, based on the asset.
While sources are already filtered by asset type, there may be different
properties that determine if a source is applicable.
In our case, we use a special prefix on some projects to indicate a special
source (like a special S3 location). The source will always be the first
source, so we can be sure the prefixed projects are always loaded from the
right source. But if the prefix is missing the url function should be able
to indicate a skip by returning false. Throwing an error is not handled and
results in a failure of the app.
Copy link
Contributor

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

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

Thanks for so thoroughly explaining the reason for the change! Looks fine to me :)

@cwillisf cwillisf merged commit 8461b83 into scratchfoundation:develop Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants