Skip to content

Commit

Permalink
revert: Remove ignoreWarmup option
Browse files Browse the repository at this point in the history
Previous implementation was from a misunderstanding of CozyPouchLink
mechanisms

As we don't need to specify warmup queries in CozyPouchLink
instanciation, we don't need the `ignoreWarmup` as we would result to
the same behavior of having no warmup queries

Warmup queries concept is meant to be removed into the future as we
won't be able to use them when offline and the scenario that needed
them (cozy-banks and cozy-drive apps) does not exist anymore

This replies to #1506 (comment)

Related commit: bb43ae9
  • Loading branch information
Ldoppea committed Sep 4, 2024
1 parent 7b216ae commit 813017e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/cozy-pouch-link/src/CozyPouchLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class PouchLink extends CozyLink {
constructor(opts) {
const options = defaults({}, opts, DEFAULT_OPTIONS)
super(options)
const { doctypes, doctypesReplicationOptions, ignoreWarmup } = options
const { doctypes, doctypesReplicationOptions } = options
this.options = options
if (!doctypes) {
throw new Error(
Expand All @@ -100,7 +100,6 @@ class PouchLink extends CozyLink {
this.storage = new PouchLocalStorage(
options.platform?.storage || platformWeb.storage
)
this.ignoreWarmup = ignoreWarmup

/** @type {Record<string, ReplicationStatus>} - Stores replication states per doctype */
this.replicationStatus = this.replicationStatus || {}
Expand Down Expand Up @@ -366,7 +365,7 @@ class PouchLink extends CozyLink {
return forward(operation)
}

if (!this.ignoreWarmup && (await this.needsToWaitWarmup(doctype))) {
if ((await this.needsToWaitWarmup(doctype))) {
if (process.env.NODE_ENV !== 'production') {
logger.info(
`Tried to access local ${doctype} but not warmuped yet. Forwarding the operation to next link`
Expand Down

0 comments on commit 813017e

Please sign in to comment.