iPolloWork icon indicating copy to clipboard operation
iPolloWork copied to clipboard

Reject unsupported template package filename extensions

Open IPollo-1 opened this issue 4 months ago • 1 comments

We should tighten the filename contract around our new .ipwp compatibility path.

Right now templatePackageMediaTypeForFilename() returns the legacy MIME type only for filenames ending in .ipwt; every other filename falls through to application/vnd.ipollowork.package+zip. The file picker limits normal UI selection to .ipwp,.ipwt, but the shared client method is also callable programmatically, so a file named template.zip, template.txt, or even an extensionless file is sent to our import endpoint as a canonical iPolloWork package.

A quick check is enough to reproduce the classification:

templatePackageMediaTypeForFilename("template.ipwt") // legacy type
templatePackageMediaTypeForFilename("template.ipwp") // canonical type
templatePackageMediaTypeForFilename("template.zip")  // canonical type too
templatePackageMediaTypeForFilename("template.txt")  // canonical type too

This matters because our media type currently claims a stronger format guarantee than the filename helper actually verifies. It can also make API/import errors confusing for callers outside the file picker.

It would be helpful for us to make the helper return a nullable/validated result or throw for unsupported extensions, then have the client reject the file before upload. A focused unit test covering uppercase .IPWP/.IPWT plus .zip, .txt, and no extension would lock the intended behavior down. The server should keep validating package contents independently, of course.

IPollo-1 avatar Aug 03 '26 09:08 IPollo-1

The issue has been fixed. Please download our new product release.

Devin-AXIS avatar Aug 03 '26 09:08 Devin-AXIS