Skip to content

Fixed AsyncStorage exists not throwing errors - #325

Open
kitwtnb wants to merge 3 commits into
hyperoslo:masterfrom
kitwtnb:fix-exists
Open

Fixed AsyncStorage exists not throwing errors#325
kitwtnb wants to merge 3 commits into
hyperoslo:masterfrom
kitwtnb:fix-exists

Conversation

@kitwtnb

@kitwtnbkitwtnb commented May 27, 2024

Copy link
Copy Markdown
Contributor

Current existsObject() returns true or throw error, not returning false.
As per StorageAware, existsObject() should not throw an error.
Fix existsObject() to return false instead of error.

@3lvis

3lvis commented Jun 4, 2024

Copy link
Copy Markdown
Collaborator

Hi @kitwtnb,

Would you be so kind on adding a tests that reproduces the error as well to avoid regressions?

@kitwtnb

Copy link
Copy Markdown
ContributorAuthor

Changed Result<Bool, Error> to Bool and removed throws.
So we could express by type that the previous problem does not regression.

Do I need to test separately from these?

@3lvis

Copy link
Copy Markdown
Collaborator

Can anyone else verify if this breaks anything for them?

@kitwtnb

Copy link
Copy Markdown
ContributorAuthor

I understand what you are trying to say.

This test originally reproduced the problem.
I expect it to throw an Error instead of false if the object does not exist.
https://github.com/hyperoslo/Cache/pull/325/files#diff-360238a58739325a7ce97d0a648b466797db4442b6cae0592f1bb2e26c0f97d7L90

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kitwtnb@3lvis