triniwiz / triniwiz/nativescript-plugins

[nativescript-couchbase] inBatch method doesn't work on Android

Open
#170 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
87
Forks
57
Avg merge
1h 36m
Merged PRs (30d)
4

Description

Hi! I try to use the inBatch method, iOS works, but Android doesn't.

      const processingLoop = () => {
        for (let i = 0; i < claims.length; i++) {
          const documentId = 'claim_' + claims[i].id;
          const existingDocument = this.database.getDocument(documentId);
          // add a unique type, since couchbase does not have the name of collections or tables
          Object.assign(claims[i], { _type: 'claim' });

          if (!existingDocument) {
            this.database.createDocument(claims[i], documentId);
          } else {
            this.database.updateDocument(documentId, claims[i]);
          }
        }
      };
      
      try {
        this.database.inBatch(() => processingLoop());
      } catch (e) {
        console.log('e);
      }

2023-01-31_12-27-53

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Android implementation or entry point for the nativescript-couchbase inBatch method and compare its behavior with the working iOS path. No source file or test is named in the report, so first identify the relevant Android code and an existing test or reproduction; done means the shown batch loop works on Android as it does on iOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
database, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.