[GH-ISSUE #13] There is a problem with replication #12

Closed
opened 2026-05-23 08:34:00 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @topapp2030 on GitHub (Aug 1, 2021).
Original GitHub issue: https://github.com/appy-one/acebase-client/issues/13

Originally assigned to: @appy-one on GitHub.

Hello!
There is a problem with replication
The situation in which it occurs, if the port is closed in the server
Data has been sent from the client
Then a minute later, the data will disappear from the client device
Even if the port is opened after that, the data will not arrive
I hope my explanation is clear or tell me to explain to you in a video

This is the server code :

const { AceBaseServer } = require('acebase-server');
const dbname = 'serverdb';
const settings = {
    host: '192.168.1.108',
    port: 5757,
    authentication: {
        enabled: true,
        allowUserSignup: true,
        defaultAccessRule: 'auth',
        defaultAdminPassword: '123456'
    }
}
const server = new AceBaseServer(dbname, settings);
server.ready(() => {
  console.log('Server running 3333333'); 
})

This is the client code:

const { AceBase } = require('acebase');
const { AceBaseClient } = require('acebase-client');
const localdb = AceBase.WithIndexedDB('localdb');  // browser
const db = new AceBaseClient({ cache: { db: localdb },host: '192.168.1.108', port: 5757, dbname: 'serverdb', https: false });
db.auth.signIn('admin', '123456')

function push(){
  db.ref('game/config').push({name: new Date() ,test : 111111});
}
Originally created by @topapp2030 on GitHub (Aug 1, 2021). Original GitHub issue: https://github.com/appy-one/acebase-client/issues/13 Originally assigned to: @appy-one on GitHub. Hello! There is a problem with replication The situation in which it occurs, if the port is closed in the server Data has been sent from the client Then a minute later, the data will disappear from the client device Even if the port is opened after that, the data will not arrive I hope my explanation is clear or tell me to explain to you in a video This is the server code : ``` const { AceBaseServer } = require('acebase-server'); const dbname = 'serverdb'; const settings = { host: '192.168.1.108', port: 5757, authentication: { enabled: true, allowUserSignup: true, defaultAccessRule: 'auth', defaultAdminPassword: '123456' } } const server = new AceBaseServer(dbname, settings); server.ready(() => { console.log('Server running 3333333'); }) ``` This is the client code: ``` const { AceBase } = require('acebase'); const { AceBaseClient } = require('acebase-client'); const localdb = AceBase.WithIndexedDB('localdb'); // browser const db = new AceBaseClient({ cache: { db: localdb },host: '192.168.1.108', port: 5757, dbname: 'serverdb', https: false }); db.auth.signIn('admin', '123456') function push(){ db.ref('game/config').push({name: new Date() ,test : 111111}); } ```
Author
Owner

@topapp2030 commented on GitHub (Aug 1, 2021):

@appy-one I think the problem is with the sending order
It should check if the server port is open
Because here the error occurs and deletes the data from the client

<!-- gh-comment-id:890546018 --> @topapp2030 commented on GitHub (Aug 1, 2021): @appy-one I think the problem is with the sending order It should check if the server port is open Because here the error occurs and deletes the data from the client
Author
Owner

@appy-one commented on GitHub (Aug 5, 2021):

It's true that sync will remove pending mutations upon failure (I will change this behaviour in a future version), but sync only runs after it has connected to the server (and signed in) so that can't be the issue.

I don't see any data retrieval code in your samples so it is kind of hard to see what is going wrong. I do see you are not waiting for the signIn to complete so that might be part of your issue - your server config requires authentication so anything you do before signing in will fail

<!-- gh-comment-id:893371132 --> @appy-one commented on GitHub (Aug 5, 2021): It's true that sync will remove pending mutations upon failure (I will change this behaviour in a future version), but sync only runs after it has connected to the server (and signed in) so that can't be the issue. I don't see any data retrieval code in your samples so it is kind of hard to see what is going wrong. I do see you are not waiting for the `signIn` to complete so that might be part of your issue - your server config requires authentication so anything you do before signing in will fail
Author
Owner

@appy-one commented on GitHub (Aug 17, 2021):

Let me know if this is still an issue, I will close it otherwise

<!-- gh-comment-id:900417241 --> @appy-one commented on GitHub (Aug 17, 2021): Let me know if this is still an issue, I will close it otherwise
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase-client#12
No description provided.