Jumoo / uSync.Complete.Issues

Public Issue tracker and roadmap for uSync.Complete
https://jumoo.co.uk/usync/complete/
2 stars 1 forks source link

Uploading a new snapshot fails, with GetFileDateError #156

Closed KevinJump closed 2 years ago

KevinJump commented 2 years ago

Reported via Forums: https://our.umbraco.com/packages/developer-tools/usync/usync/108111-usync-snapshots-import-error-in-getdatefromfolder

When I import a snapshot on my local machine, it creates a folder with a random name eg "1ruguqhz.zbi"

When I try to reload the list of snapshots, I get an error from umbraco/backoffice/usync/snapshotapi/GetSnapshots

System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter 'length')
   at System.String.Substring(Int32 startIndex, Int32 length)
   at uSync.Snapshots.Services.SnapshotService.GetDateFromFolder(String folder)
   at uSync.Snapshots.Services.SnapshotService.GetSnapshotInfo(String folder, Boolean local)

If I rename the random folder back to the name of the zip, then the list of snapshots starts working again

KevinJump commented 2 years ago

Fixed for 9,0.6 - need to ensure we extract the date info from the uploaded file name (while still protecting against random paths in the filename)

KevinJump commented 2 years ago

Doing some slightly bigger fix for this in 9.1 - moving the info about snapshot into a file stored in the root, so we don't have to care as much about the formatting of the folder.

KevinJump commented 2 years ago

In nightly : https://dev.azure.com/jumoo/Public/_packaging?_a=package&feed=nightly&package=uSync.Complete&protocolType=NuGet&version=9.0.7-rc001.20220125.1