question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple serious errors in JSON Data causing exception and ambiguity in processing

See original GitHub issue

So this is something that needs to be fixed asap. Codebase is identical, but the result is different on Android and on iOS. Thre are multiple errors here.

Both tests same values using below for Facebook

 contentMetadata: {
                         '$state': "main.tabs.single",
                         '$stateParams': {"postId": post.id},
                         something_else:{test:'bar'},
                         '$og_app_id': bt_const.fbAPPId
                       }

Test 1 Android

Result in dashboard

{
  "$og_app_id": "1757534501136057",
  "$stateParams": "{\\\"postId\\\":\\\"571c1d4ba5800ace7c9e4558\\\"}",
  "~creation_source": 2,
  "$og_title": "Is our president evil? Yes or No ?",
  "~tags": [],
  "$content_type": "",
  "~channel": "Facebook",
  "$state": "main.tabs.single",
  "source": "android",
  "$og_image_url": "https://api.grademill.com/api/localstorages/shared_2016-4-28/download/dc3d559a-df92-4551-b5f6-f8fab69ccf13.jpg",
  "$og_description": "This is a question, shared by @barocsi! Click and answer on Grademill asap, the real-time decision making app!",
  "$one_time_use": false,
  "$identity_id": "253230631314557549",
  "something_else": "{\\\"test\\\":\\\"bar\\\"}",
  "$canonical_identifier": "571c1d4ba5800ace7c9e4558_1461840113431",
  "$exp_date": "0",
  "~feature": "share",
  "$keywords": [],
  "~id": "254182727471912546",
  "+url": "bnc.lt/F5kk/iJsxzC3jWs",
  "$canonical_url": ""
}

Test 2 iOS

Result in dashboard:

{
  "$og_app_id": "1757534501136057",
  "$stateParams": {"postId": "571c1d4ba5800ace7c9e4558"},
  "~creation_source": 3,
  "$og_title": "Is our president evil? Yes or No ?",
  "~channel": "facebook",
  "~feature": "share",
  "$state": "main.tabs.single",
  "$og_description": "This is a question, shared by @barocsi! Click and answer on Grademill asap, the real-time decision making app!",
  "~stage": "my_post",
  "$one_time_use": false,
  "$identity_id": "253230631314557549",
  "something_else": {"test": "bar"},
  "$canonical_identifier": "571c1d4ba5800ace7c9e4558_1461840337208",
  "$exp_date": 0,
  "$og_image_url": "https://api.grademill.com/api/localstorages/shared_2016-4-28/download/d7336874-06e6-4cbe-8082-547c696c7bcf.jpg",
  "$publicly_indexable": 1,
  "~id": "254183698788828614",
  "+url": "bnc.lt/F5kk/mTfaOIkkWs"
}

Problems:

  1. ~channel names are different. This is not good if later one wants to combine statistics.
  2. Double escaping causes exception when processing link metadata generated by Android
  3. Stage parameter is still missing from Android generated link as stated to be resolved in https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/122 but apparently not (probably I am using a wrong version 2.0.12.

Please fix, I wonder other clients never bump into these.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
barocsicommented, Apr 29, 2016

Meanwhile this workaround did the trick

      if (typeof payload.$stateParams == 'string') {
        var __unescaped = payload.$stateParams.replace(/\\/g, "");
        payload.$stateParams = JSON.parse(__unescaped);
      }
1reaction
computerjazzcommented, Sep 7, 2017

Whoops, wrong repo – I’m on React Native. Will report the issue there. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reducing Ambiguity in Json Schema Discovery
This generality makes the resulting schemas ill suited for use in data validation. Example 1. Consider the two Json records in Figure 1....
Read more >
JSON error handling
In cases where a JavaScript Object Notation (JSON) transaction fails, the API Gateway can use a JSON error to convey error information to...
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
SyntaxError: JSON.parse: bad parsing. The JavaScript exceptions thrown by JSON.parse() occur when string failed to be parsed as JSON.
Read more >
Top 10 C++ header file mistakes and how to fix them
Mistake # 1: Not using “include guards” in a header file. ... a file will need to be processed multiple times and can...
Read more >
XSL Transformations (XSLT) Version 3.0
Abstract. This specification defines the syntax and semantics of XSLT 3.0, a language designed primarily for transforming XML documents into ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found