Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

Prevent caching of video endpoint on Android - #5710

Merged
SiobhyB merged 5 commits into
trunkfrom
disable-caching-for-video-endpoint
May 4, 2023
Merged

SiobhyB merged 5 commits into
trunkfrom
disable-caching-for-video-endpoint

Conversation

@SiobhyB

@SiobhyB SiobhyB commented May 1, 2023 •

Copy link
Copy Markdown
Contributor

Description

As outlined in WordPress/gutenberg#50216, a new filter, native.disabled_caching_endpoints, has been introduced that can dynamically extend the list of endpoints that shouldn't be cached on Android devices.

This PR utilises that changes in order to add the /rest\/v1.1\/videos.*/i endpoint to the DISABLED_CACHING_ENDPOINTS. This means any requests made to this endpoint will not be cached, which fixes the issue described here with VideoPress settings being reset on Android.

Note, support for the /rest\/v1.1\/videos.*/i endpoint was added in #5652 and it's currently only used for VideoPress requests, as such no regressions are expected to emerge from this change.

Testing

  • In the Android app, navigate through the steps to add the VideoPress block to the editor.
  • Choose the option to upload a video from your device.
  • Open the settings panel to edit the video's title and description.
  • Exit the editor.
  • Re-open the editor and open the settings panel.
  • Verify that the updated title and description remain and don't reset.
  • Go through some other general flows related to the VideoPress block's settings (e.g. updating then saving) to verify there are no other regressions.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes more info and have added them to RELEASE-NOTES.txt if necessary.

The new endpoint `/rest\/v1.1\/videos.*/i` has been added via the 'native.disabled_caching_endpoints' filter. This means that any requests made to this endpoint will not be cached on Android.
@SiobhyB SiobhyB self-assigned this May 1, 2023
@SiobhyB SiobhyB changed the title Extend non-cached endpoints on Android Prevent caching of video endpoint on Android May 1, 2023
@SiobhyB
SiobhyB marked this pull request as ready for review May 1, 2023 11:09
@SiobhyB
SiobhyB requested review from fluiddot and jhnstn May 1, 2023 11:09

@fluiddot fluiddot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🎊 !

I confirmed that updates to title and description settings remain and don't reset after saving and opening a post.

@peril-wordpress-mobile

peril-wordpress-mobile Bot commented May 4, 2023 •

Copy link
Copy Markdown

Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job!

@SiobhyB
SiobhyB enabled auto-merge May 4, 2023 16:56
@SiobhyB
SiobhyB merged commit 2291435 into trunk May 4, 2023
@SiobhyB
SiobhyB deleted the disable-caching-for-video-endpoint branch May 4, 2023 17:32
@fluiddot fluiddot added this to the 1.95.0 (22.4) milestone May 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants