Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Make write Idempotent #96

Closed
Xuanwo opened this issue Jun 8, 2021 · 4 comments
Closed

Make write Idempotent #96

Xuanwo opened this issue Jun 8, 2021 · 4 comments
Labels

Comments

@Xuanwo
Copy link
Contributor

Xuanwo commented Jun 8, 2021

Write will always create files without returned file exists?

If we made this change, all our API will be Idempotent.

@Xuanwo Xuanwo added the proposal label Jun 8, 2021
@JinnyYi
Copy link
Contributor

JinnyYi commented Jul 2, 2021

Maybe we should change the writemode to WriteModeOverwrite in go-service-dropbox to overwrite the existing file instead of getting the path/conflict/file error?
ref: https://github.com/dropbox/dropbox-sdk-go-unofficial/blob/master/v6/dropbox/files/types.go#L5101-L5124

GitHub
⚠️ An UNOFFICIAL Dropbox v2 API SDK for Go. Contribute to dropbox/dropbox-sdk-go-unofficial development by creating an account on GitHub.

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Jul 2, 2021

Maybe we could solve this problem together with #130.

Is it possible all API idempotent? (except API like CreateXxxx)?

@JinnyYi
Copy link
Contributor

JinnyYi commented Jul 2, 2021

Write will always create files without returned file exists?

I'm confused about idempotent.
As for write, I think write is idempotent in go-service-*(exclude the services in alpha state, I'm not familiar with them) when multiple requests carry the same centent(In dropbox, the conflict occurs in the case where there's a file at the target path with contents different from the contents you're trying to write).

Creating files without returned file exists means overwrite or ignor the error when two write requests carry the different content?

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Jul 7, 2021

Tracked in beyondstorage/go-storage#624

@Xuanwo Xuanwo closed this as completed Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants