microsoft / microsoft/fluentui-apple
Tooltip could crash during runtime because of `preconditionFailure()`
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 977
- Forks
- 180
- Avg merge
- 21h 38m
- Merged PRs (30d)
- 1
Description
Environment Information
- Platform:
- iOS: any
- macOS: any
- Package version(s): (fill this out, include which package manager you're using): latest
- Xcode and OS versions: (fill this out if relevant): any version supported
Please provide a reproduction of the bug:
The anchorView's window can be nil when it got removed from the view hierarchy.
In this situation, preconditionFailure() will lead to runtime crash.
Since Tooltip isn't a critical UI for most business logic, should we crash the app when this exception happens?
I searched for preconditionFailure() in this repo (https://github.com/microsoft/fluentui-apple/search?p=1&q=preconditionFailure) and found that most of its use is for unimplemented initializers.
Actual behavior:
Tooltip could crash the app.
Expected behavior:
This UI component shouldn't crash app. Or at least, we can have an alternative to crash (runtime error log?)
Priorities and help requested:
Are you willing to submit a PR to fix? No. Or yes if we have a clear path to fix it.
Requested priority: Normal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the Tooltip implementation for preconditionFailure and inspect the anchorView/window handling; reproduce the case after the view leaves the hierarchy. Done means the component no longer crashes in that situation and the chosen alternative behavior is covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- desktop, mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100