Skip to content

Conversation

@alexluckett
Copy link
Contributor

@alexluckett alexluckett commented Oct 3, 2025

Context

When a user uploads a file, we poll the backend to check the file upload status at /{prefix}/upload-status/{uploadId}. However, prefix is not known to the client-side JS and may even be missing if a developer doesn't register forms-engine-plugin with a prefix.

Problem

[ This is no longer actually a problem as I fixed the immediate issue in main, however my fix is brittle ]

Currently, our file-upload JS breaks if the plugin doesn't have a prefix. So we need better logic to determine the "base path" of the plugin.

Solution

Introduce a new manifest plugin that sits on a fixed URL, giving client-side JS a predictable path to build URLs by using the config it returns.

buildUploadStatusUrl shows why this is useful.

Pros:

  • Allows us to build predictable URLs
  • Means URLs aren't brittle, e.g. if the URL structure of file upload pages changed

Cons:

  • Server registration options for engine are passed through as plugin registration options. Slightly unusual, although not major.
  • Collissions if our plugin is registered multiple times. Moderately important, although I don't think anyone does this currently.
image

@alexluckett alexluckett changed the title [SPIKE]New manifest to help build predictable URLs [SPIKE] New manifest to help build predictable URLs Oct 3, 2025
@alexluckett alexluckett marked this pull request as draft October 3, 2025 15:59
@alexluckett alexluckett force-pushed the spike/forms-manifest branch from 5f86511 to 65c2563 Compare October 3, 2025 16:00
@alexluckett alexluckett force-pushed the spike/forms-manifest branch from d1798a9 to 51e2ed1 Compare October 3, 2025 16:05
@alexluckett alexluckett closed this Oct 3, 2025
@alexluckett alexluckett reopened this Oct 3, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

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.

2 participants