Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4469

Refactor CoreSite class

    XMLWordPrintable

Details

    • Moodle Apps - 2023 Sprint i4.2, Moodle Apps - 2024 i1, Moodle Apps - 2024 i1.1

    Description

      Our CoreSite class was created to represent a site where the user has authenticated and is supported by the app. This class allows calling WebServices, storing data in cache, etc. However, at some point we reused this class during the login process to avoid duplicating logic, but at that point there are some features that we don't want to support, like storing data in DB cache. We did some minor tweaks to avoid that without doing a refactor, but ideally we should have used a better solution.

      Also, we have some logic duplicated between CoreSite and CoreLoginHelper, depending on whether the user has authenticated or not. This makes it harder to maintain this code and it's more likely to have human error.

      It would be better to have different classes of Site depending on the user state and what can the site do at that point: before the user has authenticated (the app has no token yet), when the user has authenticated but we haven't validated that the site is supported in the app (e.g. it could be an old Moodle site), and then the CoreSite we already have.

      Attachments

        Activity

          People

            dpalou Dani Palou
            dpalou Dani Palou
            Noel De Martin Noel De Martin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Clockify

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.