Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Make backingStore optional rather than force unwrapped #444

Open
alessdiimperio opened this issue Sep 27, 2023 · 2 comments
Open

Comments

@alessdiimperio
Copy link

New Feature / Enhancement Checklist

Current Limitation

when launching tests one doesn't necessarily want the entire app and all it's dependencies setup and initialized. So if we are running tests we generally skip certain setup functions.

However after migrating to ParseSwift from the ObjC SDK i realized that we were getting crashes only when testing.
The reason for the crash was calling Installation.current which returns an optional Installation. However the backingStore is force unwrapped so even though the value is optional the underlying force unwrapped store crashes.
Note the cause is that we don't initialize parse when running tests.

if the backingStore was optional instead of force unwrapped it wouldn't crash but instead just return nil.

Feature / Enhancement Description

change ! to ? and allow for the backingStore to be optional rather than force unwrapping it.
at worst you'll have to add a few ? here and there but will allow for returning an optional value where an optional value is to be returned.

Example Use Case

running tests without having to initialize all dependencies

Alternatives / Workarounds

🤷

3rd Party References

force unwrapping is 👿 no bueno :P

@parse-github-assistant
Copy link

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@alessdiimperio
Copy link
Author

#445

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant