fix(backend-pg): userID is nullable

This commit is contained in:
ShiKhu 2022-01-31 21:08:01 +01:00
parent c087639a68
commit 0b246a0f0d
3 changed files with 4 additions and 3 deletions

View file

@ -36,7 +36,7 @@ func (c *PGCache) InsertUserID(sessionID uint64, userID *IOSUserID) error {
if err != nil {
return err
}
session.UserID = userID.Value
session.UserID = &userID.Value
return nil
}

View file

@ -29,7 +29,7 @@ func (c *PGCache) InsertWebSessionStart(sessionID uint64, s *SessionStart) error
UserDeviceType: s.UserDeviceType,
UserDeviceMemorySize: s.UserDeviceMemorySize,
UserDeviceHeapSize: s.UserDeviceHeapSize,
UserID: s.UserID,
UserID: &s.UserID,
}
if err := c.Conn.InsertSessionStart(sessionID, c.sessions[sessionID]); err != nil {
c.sessions[sessionID] = nil

View file

@ -16,7 +16,8 @@ type Session struct {
PagesCount int
EventsCount int
ErrorsCount int
UserID string // pointer??
UserID *string // pointer??
UserAnonymousID *string
Metadata1 *string
Metadata2 *string