Skip to content

Conversation

@moooji
Copy link

@moooji moooji commented Jan 11, 2017

setPersistence has to be called before any database references have been created. Since the database constructor immediately creates refs to .info/serverTimeOffset, calling setPersistence will always throw and it is not possible to enable persistence currently. Furthermore, setPersistence is not part of the Web SDK API anyway.

To fix this issue #216, this PR makes setPersistence internal and adds instead an option persistence that can be supplied to the Firestack constructor. This guarantees that persistence will be enabled before any refs are created. The default value is false.

const firestack = new Firestack({ persistence: true }); 
@moooji moooji changed the title Add option 'persistence' and make setPersistence internal [v3] Add option 'persistence' and make setPersistence internal Jan 11, 2017
@Salakar
Copy link
Collaborator

Salakar commented Jan 11, 2017

We use v3 in our prod app as it currently is, with persistence enabled and we don't face this issue, don't think its this causing the issue?

@moooji
Copy link
Author

moooji commented Jan 11, 2017

@Salakar I continue the discussion here so that we do not have 2 separate threads going on #216

@Salakar
Copy link
Collaborator

Salakar commented Jan 12, 2017

@Ehesp , can you confirm, we've notnhad this issue right?

@Ehesp
Copy link
Contributor

Ehesp commented Jan 12, 2017

Commented on other issue. Might as well close this.

@auser
Copy link
Contributor

auser commented Jan 12, 2017

I really like this update. Will continue with the other thread.

@auser auser closed this Jan 12, 2017
@benadamstyles
Copy link

@auser Do you think this PR could be merged, or did you close it because you don't think it should be? There's a lot of love for it over in #216 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants