[TIMOB-20104] iOS: Edge case where Backbone events are not passed across modules
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 5.1.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Unknown |
Created | 2015-12-07T14:54:46.000+0000 |
Updated | 2018-02-28T19:55:16.000+0000 |
Description
> *WARNING:* This is a weird edge case :(
Attached you'll find an Alloy project that:
* Has two *identical* libraries, the only difference is their filename
* The libraries their
module.exports
are extended by Backbone.Events
* The libraries export an init function to let them listen to Ti.App:resume
and in turn trigger a resume
event on themselves.
* The libraries also listen to the event they trigger themselves.
* The index controller requires both libraries, listens to them and calls their init()
function.
Now when you run the app, move it to background and then foreground again you'll see:
[INFO] Ti.App:resume in helper.js
[INFO] helper:resume in index.js
[INFO] helper:resume in helper.js
[INFO] Ti.App:resume in watchSession.js
[INFO] watchSession:resume in watchSession.js
As you can see one is missing:
[INFO] watchSession:resume in index.js
I have no idea why. I do know that it resolves as soon as:
* You rename watchSession.js
to watchsession.js
or anything else.
* You move code from the library init()
function outside of ti.
* You export a property which is a clone of Backbone.Events
and use that for the events.
So yes, it's simple to resolve, but I report it for two reasons:
1. I can't stand it when something (doesn't) work(s) and I don't get why.
2. It might be a harmless symptom of a more critical issue.
Attachments
File | Date | Size |
---|---|---|
backbonify.zip | 2015-12-07T14:54:36.000+0000 | 5528328 |
No comments