openedx / openedx/openedx-app-ios

[iOS] JSON parsing error is showing up in log when openeing the Dasbhoard viewmodel

Open
#359 3 comments 1 reaction 1 assignee View on GitHub

@volodymyr-chekyrta is already working on this.

Since Mar 20, 2024.

  • #360 by @volodymyr-chekyrta — merged
Dominant language
Swift
Stars
31
Forks
32
PR merge metrics
No merged PRs in 30d

Description

Steps to reproduce
  1. Where are you starting? What can you see?

A newly compiled app from develop branch connected to my server blue.zeitlabs.com which is Open edX master backend (more recent the Quince).

  1. What do you click?

The dashboard button.

We got this error in the mobile error:

valueNotFound(Swift.Array<Swift.String>, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "enrollments", intValue: nil), CodingKeys(stringValue: "results", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "course", intValue: nil), CodingKeys(stringValue: "discussion_url", intValue: nil)], debugDescription: "Cannot get unkeyed decoding container -- found null value instead", underlyingError: nil))
HTTP Request
Request: GET https://blue.zeitlabs.com/api/mobile/v3/users/omarstudent/course_enrollments?page=1

{
  "configs": {
    "iap_configs": {}
  },
  "enrollments": {
    "next": null,
    "previous": null,
    "count": 2,
    "num_pages": 1,
    "current_page": 1,
    "start": 0,
    "results": [
      {
        "audit_access_expires": null,
        "created": "2024-02-29T12:51:54.025316Z",
        "mode": "audit",
        "is_active": true,
        "course": {
          "id": "course-v1:futurex+test101+2024",
          "name": "The Test Bank example course",
          "number": "test101",
          "org": "futurex",
          "start": "2020-01-01T00:00:00Z",
          "start_display": "Jan. 1, 2020",
          "start_type": "timestamp",
          "end": null,
          "dynamic_upgrade_deadline": null,
          "subscription_id": "course_MNXXK4TTMUWXMMJ2MZ2XI5LSMV4CW5DFON2DCMBRFMZDAMRU",
          "courseware_access": {
            "has_access": true,
            "error_code": null,
            "developer_message": null,
            "user_message": null,
            "additional_context_user_message": null,
            "user_fragment": null
          },
          "media": {
            "course_image": {
              "uri": "/asset-v1:futurex+test101+2024+type@asset+block@depositphotos_11930317-stock-photo-scantron-test-blocks-and-pencil.jpeg",
              "name": "Course Image"
            }
          },
          "course_image": "/asset-v1:futurex+test101+2024+type@asset+block@depositphotos_11930317-stock-photo-scantron-test-blocks-and-pencil.jpeg",
          "course_about": "https://blue.zeitlabs.com/courses/course-v1:futurex+test101+2024/about",
          "course_sharing_utm_parameters": {
            "facebook": "utm_medium=social&utm_campaign=social-sharing-db&utm_source=facebook",
            "twitter": "utm_medium=social&utm_campaign=social-sharing-db&utm_source=twitter"
          },
          "course_updates": "https://blue.zeitlabs.com/api/mobile/v3/course_info/course-v1:futurex+test101+2024/updates",
          "course_handouts": "https://blue.zeitlabs.com/api/mobile/v3/course_info/course-v1:futurex+test101+2024/handouts",
          "discussion_url": null,
          "video_outline": null,
          "is_self_paced": false
        },
        "certificate": {},
        "course_modes": [
          {
            "slug": "audit",
            "sku": null,
            "android_sku": null,
            "ios_sku": null,
            "min_price": 0
          }
        ]
      },
      {
        "audit_access_expires": null,
        "created": "2024-02-29T12:51:51.983028Z",
        "mode": "audit",
        "is_active": true,
        "course": {
          "id": "course-v1:i18n+i18n+i81n",
          "name": "Learn HTML the hard way",
          "number": "i18n",
          "org": "i18n",
          "start": "2030-01-01T00:00:00Z",
          "start_display": null,
          "start_type": "empty",
          "end": null,
          "dynamic_upgrade_deadline": null,
          "subscription_id": "course_MNXXK4TTMUWXMMJ2NEYTQ3RLNEYTQ3RLNE4DC3Q_",
          "courseware_access": {
            "has_access": false,
            "error_code": "course_not_started",
            "developer_message": "Course has not started",
            "user_message": "Course has not started",
            "additional_context_user_message": null,
            "user_fragment": null
          },
          "media": {
            "course_image": {
              "uri": "/asset-v1:i18n+i18n+i81n+type@asset+block@depositphotos_667560896-stock-photo-word-cloud-online-courses-concept.jpg",
              "name": "Course Image"
            }
          },
          "course_image": "/asset-v1:i18n+i18n+i81n+type@asset+block@depositphotos_667560896-stock-photo-word-cloud-online-courses-concept.jpg",
          "course_about": "https://blue.zeitlabs.com/courses/course-v1:i18n+i18n+i81n/about",
          "course_sharing_utm_parameters": {
            "facebook": "utm_medium=social&utm_campaign=social-sharing-db&utm_source=facebook",
            "twitter": "utm_medium=social&utm_campaign=social-sharing-db&utm_source=twitter"
          },
          "course_updates": "https://blue.zeitlabs.com/api/mobile/v3/course_info/course-v1:i18n+i18n+i81n/updates",
          "course_handouts": "https://blue.zeitlabs.com/api/mobile/v3/course_info/course-v1:i18n+i18n+i81n/handouts",
          "discussion_url": null,
          "video_outline": null,
          "is_self_paced": false
        },
        "certificate": {},
        "course_modes": [
          {
            "slug": "audit",
            "sku": null,
            "android_sku": null,
            "ios_sku": null,
            "min_price": 0
          }
        ]
      }
    ]
  }
}
Screenshot

image

Outcome
What did you expect?

See list of courses.

What happened instead?

I see empty list dashboard.

Your phone model

iPhone Simulator

Operating system version

iPhone 15 Pro simulator - iOS 17.2

Application version

develop branch (v1.0.0)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.