buttercup / buttercup-mobile

:iphone: React-Native mobile application for Buttercup
https://buttercup.pw
GNU General Public License v3.0
392 stars 70 forks source link

Request caching bug: Changes not visible after locking and unlocking vault #229

Closed powerflo closed 2 years ago

powerflo commented 4 years ago

Hi,

Changes made in the mobile application appear to be saved on the Webdav server, but not displayed in the mobile application.

Steps to reproduce: I've also made a screen recording:

  1. Open Buttercup and make a change (e.g. create group and add entry)
  2. Lock vault
  3. Unlock vault
  4. The changes made in step 1 are not visible in the mobile app
  5. The changes are visible in the desktop app

Tested on iPhone 6s, iOS 13.3.1

perry-mitchell commented 4 years ago

Hi @fanaz - I've not yet seen such an issue. Really peculiar that it doesn't seem to show the updates. For clarify - would you mind testing on another provider, say Dropbox or Google Drive, to see if it happens there too? Need to narrow it down to the device or the service.

My suspicion is it's something to do with Nextcloud, if that's what you're using. Not saying it's not a bug, but perhaps something in that part of the process.

EDIT: You might also take note of the file modification time and file size, before updating - see if they change.

powerflo commented 4 years ago

It has nothing to do with Nextcloud, the vault ist stored in my Fastmail account.

I've done further testing with different providers and I can reproduce the issue only with my two existing vaults. I've created a new vault stored at my provider and the issue does not seem to be occurring yet.

The file modification time is updated on every change.

powerflo commented 4 years ago

After more testing I can reproduce the issue with the new created vault (screen recording). I can't reproduce it with Google Drive.

To further investigate the issue, I used Charles proxy (tutorial) to debug the traffic of my iPhone: there is a PUT request when changing something in the vault. But no GET request at all. Here is a screen recording of that: https://nc.wallner.dev/s/mk8wzaFPjiW9ggi

nickbe commented 3 years ago

Same problem now here. I'm creating folders and entries on windows, which are clearly in sync with the webdav server. 2 have been tested. Seafile and Open-XChange.

The folder however is not pulled to the iOS. Everything still looks the same as before. It's like iOS is stuck somehow.

perry-mitchell commented 3 years ago

I did actually have a similar experience with Yandex (webDAV), and I'm wondering if it has something to do with this. Might have to look into how we can disable caching on every request.

If anyone finds anything before I do, please don't hesitate in sharing it here.

nickbe commented 3 years ago

Update. Yep - it seems that this is indeed a cache or delay problem. Curiously enough it didn't happen so obviously before. But maybe this is a coincidence.

The entries appear after around 20 minutes.

perry-mitchell commented 3 years ago

I gave up on Yandex (for testing) due to this issue, thinking it was just something weird with my account. Guess it's a wider issue.

Currently trying to get the mobile app working on my machine with iOS 14 - once I crack this nut I'll try to tackle this issue. It'll be a bit of legwork to add headers to every request, as I'm not sure if it's just webdav. I'll start with the WebDAV client but will probably try to do the same for: Google/Dropbox and our own Buttercup service.

perry-mitchell commented 2 years ago

I think I found the issue! After years of this being intermittent for me, I nailed it down to being the cache control behaviour of axios, while testing offline access. After adding some headers it seems to have been fixed, so I'll close this. Let me know if it persists for you after the next release.