dagstore icon indicating copy to clipboard operation
dagstore copied to clipboard

fix: PersistedShard.URL should do QueryUnescape before url.Parse.

Open ricktian1226 opened this issue 1 year ago • 0 comments

In my dev environment, PersistedShard.URL contains some escape characters, like '%2F'. The whole URL is file://%2Fhome%2Fricktian%2Fworkspace%2Flotus_dev%2Fcar%2Fbafk2bzaceddnvrk2uexrfib7yerhd754hw3ed2tfyvemkrpzflbyf2sbioswq.baga6ea4seaqbhygsit3b742jhtny3sjlznpjaevquj3unc4iugno6735z35hmny.car, And this parse directory will cause error as follow: 2023-04-17T15:52:15.006+0800 WARN dagstore [email protected]/dagstore.go:572 failed to recover state of shard /baga6ea4seaqbhygsit3b742jhtny3sjlznpjaevquj3unc4iugno6735z35hmny: failed to parse mount URL: parse "file://%2Fhome%2Fricktian%2Fworkspace%2Flotus_dev%2Fcar%2Fbafk2bzaceddnvrk2uexrfib7yerhd754hw3ed2tfyvemkrpzflbyf2sbioswq.baga6ea4seaqbhygsit3b742jhtny3sjlznpjaevquj3unc4iugno6735z35hmny.car": invalid URL escape "%2F"; skipping

So PersistedShard.URL should be QueryUnescape before Parse.

ricktian1226 avatar Apr 18 '23 07:04 ricktian1226