Jasonette / Jasonette/JASONETTE-Android
$timer behaves different in Android than iOS
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 266
- PR merge metrics
- No merged PRs in 30d
Description
In iOS, when the user leaves a view A to go to view B, a timer that was started in A appears to stop.
In Android, it appears that if a user leaves a view A (e.g. goes to another tab B) with a periodic timer called `foo` in A, if the new tab B has an action called `foo` it appears to be called with the same interval as the previous view even though there is no timer in this new view.
In iOS, the timer (if it's running) does not appear to call the same-named action in the local view, if it exists.
This is confusing and should be made identical (one way _or_ another), and some things clarified in the docs.
The behavior in Android is more general, in that a timer appears to be global no matter what and local to a view in iOS, though it's not general in the sense of triggering named actions if the actions are not local to the view.
This kind of brings up another thing to be clarified in the docs: are timers meant to continue running when a view leaves or they are local?
If they are not meant to stop (i.e. they are global), then Jasonette should have an action for when a view is "$hidden" to be able to hook up a `$timer.stop` event to it.
Contributor guide
Research direction
Start by tracing how periodic timers are created, scoped, and stopped when a view or tab changes on Android, then compare the documented behavior with the iOS behavior described in the issue. Done means the cross-platform timer lifecycle is decided, the handling of same-named actions is consistent, and the relevant documentation is clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100