JavaScript Error: "TypeError: dataCall is null" in DataCallManager.js



Firefox OS
2 years ago
2 years ago


(Reporter: jessica, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



2 years ago
Sometimes this error shows up in logs. After digging out more, I found that it happens when RILNetworkInterface is disconnected and then gets unregistered from NetworkManager very quickly. I was able to reproduce this by switching APNs on emulator-x86-kk.

The reason is because NetworkManager's processes DISCONNECTED event step by step (using promise), so when setAndConfigureActive() is finally called, it access |_activeNetwork| which holds a reference to the network interface that is already unregistered and shutdown by DataCallManager.

I'm still thinking a good way to solve this, suggestions are welcome.

Comment 1

2 years ago
Created attachment 8679209 [details] [diff] [review]
[WIP] patch.

To solve this, I propose to let NetworkManager maintain an internal object that contains information of each 'networkInterface'. In this way, NetworkManager will have full control over this internal object, hence can do the stuff it needs to do (adding routes, setting dns, fire events, etc) asynchronously, without being worried about 'networkInterface' modified by outer modules.
You need to log in before you can comment on or make changes to this bug.