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

Reduce re-download files when we don't know the timemodified (embedded files)

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 4.5
    • File system, Performance
    • Hide

      Testing this issue requires inspecting file downloads, so it should be tested by a developer.

      Ideally this issue should be tested in a real device (Android or iOS), but I'm not sure if it's easy to inspect file downloads in there (e.g. I don't know if file downloads appear in Android Studio Network inspector). If you can't inspect the file downloads in real devices then you can use the webapp to test the issue.

      1. In the app, open any page with embedded images (we have some in our testing sites, e.g. in the "Resource: Page" section of our testing course we have "A simple page with images". Check that the embedded images are downloaded.
      2. Now open the activity info menu at the top right and click "Download". Check that the embedded images are NOT re-downloaded.
      3. Copy the local path of any of the embedded images, you will need it in step 5.
      4. In LMS, edit the page, change anything in the text and save changes. This will increase the revision of all the files in the page.
      5. In the app, perform a Pull To Refresh in the page. Check that embedded images are re-downloaded now, and the path where they're stored is the same as in the step 3 (they aren't duplicated every time the revision changes).
      Show
      Testing this issue requires inspecting file downloads, so it should be tested by a developer. Ideally this issue should be tested in a real device (Android or iOS), but I'm not sure if it's easy to inspect file downloads in there (e.g. I don't know if file downloads appear in Android Studio Network inspector). If you can't inspect the file downloads in real devices then you can use the webapp to test the issue. In the app, open any page with embedded images (we have some in our testing sites, e.g. in the "Resource: Page" section of our testing course we have "A simple page with images". Check that the embedded images are downloaded. Now open the activity info menu at the top right and click "Download". Check that the embedded images are NOT re-downloaded. Copy the local path of any of the embedded images, you will need it in step 5. In LMS, edit the page, change anything in the text and save changes. This will increase the revision of all the files in the page. In the app, perform a Pull To Refresh in the page. Check that embedded images are re-downloaded now, and the path where they're stored is the same as in the step 3 (they aren't duplicated every time the revision changes).
    • MOODLE_405_STABLE
    • Moodle Apps - 2024 i3.1, Moodle Apps - 2024 i3.2

      Right now, the following can happen:

      1. I open an activity that has an embedded file (e.g. an image). The app downloads the image, but since it's embedded in the HTML we don't know its timemodified so it's downloaded with timemodified=0.
      2. Then I click to prefetch the activity. In this case we know the timemodified, but it's compared with timemodified=0 so the app thinks there is a newer version of the file and it's re-downloaded.

      We should use the downloadTime of the file to improve this (we already store it in DB). The following cases can happen:

      • I have downloaded a file which I do know the timemodified, and now I download a file that I don't know its timemodified. The file should not be re-downloaded (this already happens).
      • I have downloaded a file which I do know the timemodified, and now I download a file that I do know its timemodified. The file should only be re-downloaded if timemodified is higher (this already happens).
      • I have downloaded a file which I don't know the timemodified, and now I download a file that I don't know its timemodified. The file should not be re-downloaded (this already happens).
      • I have downloaded a file which I don't know the timemodified, and now I download a file that I do know its timemodified. The file should only be re-downloaded if timemodified is higher than the file's download time.

            dpalou Dani Palou
            dpalou Dani Palou
            Pau Ferrer Pau Ferrer
            Albert Gasset Albert Gasset
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m

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