Page MenuHomePhabricator

[Crash] Unmarshalling error when restoring tabs.
Closed, ResolvedPublic1 Estimated Story Points

Description

Not strictly a crash (logRemoteErrorIfProd), but we seem to have an error in unmarshalling our tabs, where we serialize the namespace of the page as the enum string ("MAIN") instead of the number code.

https://rink.hockeyapp.net/manage/apps/226650/app_versions/64/crash_reasons/148057613

Caused by: java.lang.NumberFormatException: Invalid double: "MAIN"
at java.lang.StringToReal.invalidReal(StringToReal.java:63)
at java.lang.StringToReal.parseName(StringToReal.java:249)
at java.lang.StringToReal.parseDouble(StringToReal.java:273)
at java.lang.Double.parseDouble(Double.java:301)
at com.google.gson.stream.JsonReader.nextInt(JsonReader.java:1193)
at org.wikipedia.json.NamespaceTypeAdapter.read(NamespaceTypeAdapter.java:20)
at org.wikipedia.json.NamespaceTypeAdapter.read(NamespaceTypeAdapter.java:11)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
...
at com.google.gson.Gson.fromJson(Gson.java:801)
at org.wikipedia.json.GsonUnmarshaller.unmarshal(GsonUnmarshaller.java:32)
at org.wikipedia.json.GsonUnmarshaller.unmarshal(GsonUnmarshaller.java:19)
at org.wikipedia.json.TabUnmarshaller.unmarshal(TabUnmarshaller.java:21)

Event Timeline

Change 325571 had a related patch set uploaded (by Dbrant):
Fix deserializing of older Namespace values (and possible crash).

https://gerrit.wikimedia.org/r/325571

Change 325571 merged by jenkins-bot:
Fix deserializing of older Namespace values (and possible crash).

https://gerrit.wikimedia.org/r/325571

Dbrant claimed this task.

So...it doesn't look like this is resolved. Looking in HockeyApp, the rate of this crash has not changed since our last release, which indicates that it's not an upgrade-related bug.
Even though it doesn't actually produce a crash, the user sees a very undesirable symptom of having their list of tabs cleared.

@Dbrant, I don't think this issue specifically is actually happening any longer in the crash report logs of the latest beta. NamespaceTypeAdapterTest.testReadOldData() explicitly exercises this scenario which now succeeds. The unmarshalling errors we're seeing in the latest beta look more like T152980 which I can stimulate in a test but I'm unsure of what the actual JSON looks like (is there an authority somewhere in the JSON we can use?).

I'm gonna mark this guy closed and reopen T152980