Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20104] iOS: Edge case where Backbone events are not passed across modules

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.1.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterFokke Zandbergen
AssigneeUnknown
Created2015-12-07T14:54:46.000+0000
Updated2018-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

FileDateSize
backbonify.zip2015-12-07T14:54:36.000+00005528328

Comments

No comments

JSON Source