Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My Tutorials - Completed tab won't load #579

Closed
heathermh opened this issue May 25, 2021 · 13 comments
Closed

My Tutorials - Completed tab won't load #579

heathermh opened this issue May 25, 2021 · 13 comments
Labels
bug Something isn't working

Comments

@heathermh
Copy link
Contributor

When user taps on My Tutorials and then the Completed tab up top, they get a never ending "Loading..." message.

Steps to reproduce

  • Open app (log in if needed)
  • Tap My Tutorials
  • Tap Completed tab

Expected behavior

I'd expect to see a list of my completed tutorials, or a message that says I haven't completed any.

Actual behavior

I get a "Loading..." message.
image

The error in xcode:
EVENT:: ["object": "CategoryRepository", "action": "Last Updated: 2021-05-25 22:24:32 +0000. No refresh required."]
["object": "CompletedRepository", "action": "Failed_repositoryLoad", "reason": "Unable to receive content summary update: failure(Emitron.DataCacheError.cacheMiss)"]
["reason": "Unable to receive content summary update: failure(Emitron.DataCacheError.cacheMiss)", "action": "Failed_repositoryLoad", "object": "CompletedRepository"]
["action": "Failed_repositoryLoad", "reason": "Unable to receive content summary update: failure(Emitron.DataCacheError.cacheMiss)", "object": "CompletedRepository"]

Environment

1.0.7 on iPhone 12pro (from app store), ios 14.5
Can also reproduce in the simulator for ios 14.5 on iPhone 11 and 12

  • iOS Version: 14.5
  • raywenderlich.com App Version: 1.0.7
  • Device: iPhone 11, 12
@byaruhaf
Copy link
Contributor

Hello @heathermh Trying to replicate this issue, have you completed any video tutorials?

@heathermh
Copy link
Contributor Author

Yes @byaruhaf I have completed some. Here’s what this info looks like on the RW web site:
3AC6EB5F-F177-4FFC-AD0E-14A054F9914B
:

@heathermh
Copy link
Contributor Author

@byaruhaf The problem is coming from an old tutorial titled "iOS & Swift Learning Path Trailer 2019" with contentId = 775835. If I bypass that record, the completed list loads just fine.

@byaruhaf
Copy link
Contributor

byaruhaf commented May 27, 2021

@heathermh yes I am able to replicate the issue just by completing the iOS & Swift Learning Path Trailer 2019.

if you wait long enough you get the following page, which is wrong.

IMG_B2933D2C5434-1

@sammyd sammyd added the bug Something isn't working label May 31, 2021
@sammyd
Copy link
Collaborator

sammyd commented May 31, 2021

Thanks for the bug report @heathermh, and thanks for confirming it @byaruhaf.

Any idea what it is about that particular item of content that is problematic? It might be a data issue that I can fix in the backend...

@byaruhaf
Copy link
Contributor

byaruhaf commented Jun 2, 2021

Hi @sammyd

From what I can see is JSON is missing both categories and domains data, see the JSON response below.
can you try adding them in the backend we see if that fixes the issue.

{
  "data": {
    "id": "775835",
    "type": "contents",
    "attributes": {
      "uri": "rw://betamax/videos/2425",
      "name": "iOS & Swift Learning Path Trailer 2019",
      "description": "<p>The trailer for the iOS &amp; Swift Learning Path 2019.</p>\n",
      "released_at": "2019-01-17T00:00:00.000Z",
      "free": true,
      "difficulty": null,
      "content_type": "screencast",
      "duration": 60,
      "popularity": 100647,
      "technology_triple_string": "",
      "contributor_string": "",
      "ordinal": null,
      "professional": false,
      "description_plain_text": "The trailer for the iOS &amp; Swift Learning Path 2019.\n",
      "video_identifier": 2425,
      "parent_name": null,
      "accessible": true,
      "card_artwork_url": null,
      "body": ""
    },
    "relationships": {
      "domains": {
        "data": [
        ]
      },
      "child_contents": {
        "meta": {
          "count": 0
        }
      },
      "progression": {
        "data": {
          "id": "253015195",
          "type": "progressions"
        }
      },
      "bookmark": {
        "data": null
      },
      "groups": {
        "data": [
        ]
      },
      "categories": {
        "data": [
        ]
      }
    },
    "links": {
      "self": "http://api.raywenderlich.com/api/contents/775835-ios-swift-learning-path-trailer-2019",
      "video_stream": "http://api.raywenderlich.com/api/videos/2425/stream",
      "video_download": "http://api.raywenderlich.com/api/videos/2425/download"
    }
  },
  "included": [
    {
      "id": "253015195",
      "type": "progressions",
      "attributes": {
        "target": 60,
        "progress": 60,
        "finished": true,
        "percent_complete": 100,
        "created_at": "2021-05-27T04:06:18.358Z",
        "updated_at": "2021-05-27T04:06:34.189Z"
      },
      "relationships": {
        "content": {
          "data": {
            "id": "775835",
            "type": "contents"
          },
          "links": {
            "self": "http://api.raywenderlich.com/api/contents/775835"
          }
        }
      },
      "links": {
        "self": "http://api.raywenderlich.com/api/progressions/253015195"
      }
    }
  ]
}

@sammyd
Copy link
Collaborator

sammyd commented Jun 2, 2021

I have added those pieces, and some other bits that were notably lacking. Let me know if this solves the problem.

Thanks!

@byaruhaf
Copy link
Contributor

byaruhaf commented Jun 2, 2021

Hi @sammyd

The problem is fixed now.

Just wondering should the code be updated to ignore the missing content summary and display the content list instead of throwing a DataCacheError

image

@sammyd
Copy link
Collaborator

sammyd commented Jun 4, 2021

@byaruhaf I'm not quite sure what you mean?

@byaruhaf
Copy link
Contributor

@sammyd I was wondering should emitron be updated to ignore bad JSON data sent from the backend instead of throwing a DataCacheError.

@0xTim
Copy link
Contributor

0xTim commented Jun 12, 2021

@byaruhaf My view is that we shouldn't try and handle server edge cases. That's a large rabbit hole that doesn't provide huge benefits for a lot of work. We should just show an error message

@sammyd
Copy link
Collaborator

sammyd commented Jun 12, 2021

I'm in agreement with @0xTim. Maybe there is some work to show errors rather than hanging? But let's not put any effort into trying to magically recover from them.

@sammyd
Copy link
Collaborator

sammyd commented Jun 12, 2021

Closing this as this particular issue is handled. Please feel free to open up an additional issue with changes to error display if you'd like.

@sammyd sammyd closed this as completed Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants