Can microsecond precision be kept in firestore_web? #4731
              
                Unanswered
              
          
                  
                    
                      ditman
                    
                  
                
                  asked this question in
                Feature request
              
            Replies: 1 comment
-
| I stumbled upon this issue as I'm using the Timestamp to DateTime and the  The issue seems to be happening only on Flutter web. On mobile it works fine. Not a great solution but with this approach it manages to decode the encrypted data after 3 max retries. Sometimes it works with the 1st run. Still an issue after 3+ years... | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
As seen in this bug, when converting Firestore Timestamps to a web DateTime, the code is just using milliseconds. See code here, and here, losing microsecond precision if written by a mobile client.
However, it seems that DateTime may support
fromMicrosecondsSinceEpoch(docs) and the JS Timestamp seems to store up tonanoseconsfor Timestamps (code). It also has a constructor that allows Timestamps to be created from seconds + nanoseconds.Would it be possible to keep microsecond precision for Timestamps in the the web implementation of Firestore?
Beta Was this translation helpful? Give feedback.
All reactions