2

I have a web application that uses RxDB ( https://rxdb.info/ ) to store data in indexedDB. I encountered an issue where when I clear the data in indexedDB using the clearTODOS method in one tab, the data still remains accessible in other tabs until I refresh the page.

I expect that clearing the data in one tab will make it inaccessible in other tabs. I've been searching for a solution to this problem but haven't found a suitable approach yet.

Currently, my workaround is to store information about the deleted data in local storage/cache and manually clear them when switching to other tabs, but I believe there is a more proper approach.

I suspect that the issue is that each browser tab has its own instance of RxDB, even if they are working with the same IndexedDB database. But still, how to deal with this?

So, is it possible to sync an RxDB instance with the actual IndexedDB when switching tabs?

Update: I find that the problem is in the collection.remove method since, for some reason, it isn't tracked by RxDB for some reason

Update: the remove operation on the collection itself does not generate a change event and this is my issue if we just remove each document separately, it solves the problem, but still remove collection is much faster operation, and it should be fixed

0

Browse other questions tagged or ask your own question.