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

Logs stored in offline aren't deleted if WS returns an error

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test on one device of your choice.

      1. Add a new site in the app and open a course.
      2. Go offline.
      3. Open a database. You should see an error saying you aren't connected.
      4. Leave the database and go online.
      5. Wait the sync cron to run (5-10 minutes).
      6. Check the app is not doing requests to log database without sending an ID.
      7. Check the table 'course_activity_log' on the DB of the site does not have any database to log.
      8. Add a wiki page in offline.
      9. Leave the wiki and go online.
      10. Wait the sync cron to run (5-10 minutes).
      11. Check the app is not doing requests to log wiki without sending a pageid.
      12. Check the table 'course_activity_log' on the DB of the site does not have any wiki to log.
      Show
      Test on one device of your choice. Add a new site in the app and open a course. Go offline. Open a database. You should see an error saying you aren't connected. Leave the database and go online. Wait the sync cron to run (5-10 minutes). Check the app is not doing requests to log database without sending an ID. Check the table 'course_activity_log' on the DB of the site does not have any database to log. Add a wiki page in offline. Leave the wiki and go online. Wait the sync cron to run (5-10 minutes). Check the app is not doing requests to log wiki without sending a pageid. Check the table 'course_activity_log' on the DB of the site does not have any wiki to log.
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
    • Sprint:
      Moodle App 3.8.0

      Description

      If you open in offline a database that hasn't been opened before, the logView function is called without a databaseid. This data is stored in a local DB, so the app will call the WS to view a database without the ID, so the WS fails. The app should delete the log if the WS returns an error, but it doesn't so the call is retried every certain time.

      How to reproduce:

      1. Add a new site in the app and open a course.
      2. Go offline.
      3. Open a database. You should see an error saying you aren't connected.
      4. Leave the database and go online. The app should now start doing requests to log database without sending an ID.

      We need to fix 2 things in this issue:

      1. In database index, it calls logView if this.data exists, but this.data is initialized to an empty object so it always exists.
      2. Logs should be deleted if the WS call fails.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/Dec/19