Belt.await Typespec Wrong
The Belt.await/2
typespec is wrong. The Typespec says that an {:ok, term}
or errors are returned. Currently it returns only a term without the ok tuple though.
Comments (8)
-
repo owner -
repo owner I have updated the Provider tests to use
Belt.await/2
directly and everything seems to be working as expected here:assert {:ok, job} = Belt.store_async(config, file) assert {:ok, %Belt.FileInfo{}} = Belt.await(job)
Check out the Pipeline results here: https://bitbucket.org/pentacent/belt/addon/pipelines/home#!/results/33
https://bitbucket.org/pentacent/belt/addon/pipelines/home#!/results/33
-
Account Deleted @pentacent I should've been more specific. It only happens in the case of
delete
I think. -
repo owner @maennchen_jm Thank you for specifying this.
Belt.delete/3
returns:ok | {:error, String.t}
, so it wouldn’t really make sense forBelt.await/2
to return anything but:ok
when the operation was successful.Belt.delete_all/2
andBelt.delete_scope/3
are missing a typespec at the moment but they both return:ok
upon success as well.Maybe in the next major release we can change
Belt.delete/3
andBelt.delete_all/2
andBelt.delete_scope/3
to return{:ok, n}
wheren
is the number of deleted files.For now I will provide a fix to extend the typespec of
await/2
and add a typespec todelete_all/2
anddelete_scope/3
. -
repo owner - changed status to closed
Add missing typespecs
Add typespecs to delete_all/2 and delete_scope/3, expand typespec of await/2
Closes
#3→ <<cset f17a5e8cf138>>
-
Account Deleted @pentacent Thank You! Will you also release the change soon?
-
repo owner @maennchen_jm It’s on Hex now
-
Account Deleted 👍
- Log in to comment
Thank you for reporting this problem. This should not be happening but I was unable to reproduce it on my end. Could you post a code example?