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

fix: Dashboard parsing error #360

Merged

Conversation

volodymyr-chekyrta
Copy link
Contributor

Issue: #359

Solution Description:
Removed unused fields in the Data_Dashboard.swift to fix the parsing error.

@openedx-webhooks
Copy link

Thanks for the pull request, @volodymyr-chekyrta! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Mar 20, 2024
@volodymyr-chekyrta volodymyr-chekyrta added the bug Report of or fix for something that isn't working as intended label Mar 20, 2024
Comment on lines -138 to -139
case courseHandouts = "course_handouts"
case discussionURL = "discussion_url"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miankhalid in the production app, we are using course_handouts to show/add the Handouts in the course menu and likewise, we are using discussion_url to enable/disable course discussions and course_updates being used for course announcements. e.g if discussion_url is nil, discussion tab won't be added in the course menu on course dashboard screen.

Should we remove these or keep them and create a ticket to get parity with the production app?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to add these fields to the course home API and use them from there, we can't rely on them from the dashboard response as we have many ways to get to the course page without a dashboard (course about, deeplink, etc.).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@volodymyr-chekyrta the only downside I'm seeing with this approach is we're fattening the response of the said API. Currently, there are courses on our side whose response for Blocks has reached size close to 2 to 3Mbs.

If we keep on adding stuff, it'll only increase further. Plus, Glib will have to update his PR openedx/edx-platform#34273 even further.

For now, I do think we can update this API but in the longer run we should look into splitting these responses into atleast 2 APIs where:

  1. one would just return Blocks
  2. and the other one would return all the course related details

thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sounds reasonable 💯 👍!
But I'd like to check out the size and speed difference before we make any decisions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep that's why I've asked if Glib can do some performance & load testing before and after the change in his PR.

Comment on lines -115 to -117
public let courseUpdates: String
public let courseHandouts: String
public let discussionURL: String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider this idea: If we render all fields optional, it would prevent any disruptions in functionality, even if certain fields remain unused or no data is received from the backend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly, however, since we currently have no use for these fields, there's no need to waste resources on them.

  • Less code is less complexity for everyone 🧠
  • Less dead code, less cost of code ownership 💸 🚀

@volodymyr-chekyrta volodymyr-chekyrta merged commit 6f1ec1b into openedx:develop Mar 22, 2024
3 checks passed
@openedx-webhooks
Copy link

@volodymyr-chekyrta 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@volodymyr-chekyrta volodymyr-chekyrta deleted the fix/dashboard_parsing_issue branch March 22, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of or fix for something that isn't working as intended open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

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