@@ -61,7 +61,7 @@ const addOrUpdate = async (userData, userId = null) => {
61
61
user = await userModel . where ( "github_id" , "==" , userData . github_id ) . limit ( 1 ) . get ( ) ;
62
62
}
63
63
if ( user && ! user . empty && user . docs !== null ) {
64
- await userModel . doc ( user . docs [ 0 ] . id ) . set ( userData , { merge : true } ) ;
64
+ await userModel . doc ( user . docs [ 0 ] . id ) . set ( { ... userData , updated_at : Date . now ( ) } , { merge : true } ) ;
65
65
const data = user . docs [ 0 ] . data ( ) ;
66
66
return {
67
67
isNewUser : false ,
@@ -308,6 +308,7 @@ const setIncompleteUserDetails = async (userId) => {
308
308
if ( doc . exists ) {
309
309
return userRef . update ( {
310
310
incompleteUserDetails : false ,
311
+ updated_at : Date . now ( ) ,
311
312
} ) ;
312
313
}
313
314
return { } ;
@@ -423,6 +424,7 @@ const updateUserPicture = async (image, userId) => {
423
424
const userDoc = userModel . doc ( userId ) ;
424
425
await userDoc . update ( {
425
426
picture : image ,
427
+ updated_at : Date . now ( ) ,
426
428
} ) ;
427
429
} catch ( err ) {
428
430
logger . error ( "Error updating user picture data" , err ) ;
@@ -788,7 +790,7 @@ const updateUsersInBatch = async (usersData) => {
788
790
usersData . forEach ( ( user ) => {
789
791
const id = user . id ;
790
792
delete user . id ;
791
- bulkWriter . update ( userModel . doc ( id ) , user ) ;
793
+ bulkWriter . update ( userModel . doc ( id ) , { ... user , updated_at : Date . now ( ) } ) ;
792
794
} ) ;
793
795
794
796
await bulkWriter . close ( ) ;
@@ -913,7 +915,7 @@ const addGithubUserId = async (page, size) => {
913
915
} )
914
916
. then ( ( data ) => {
915
917
const githubUserId = data . id ;
916
- batchWrite . update ( userDoc . ref , { github_user_id : `${ githubUserId } ` } ) ;
918
+ batchWrite . update ( userDoc . ref , { github_user_id : `${ githubUserId } ` , updated_at : Date . now ( ) } ) ;
917
919
countUserFound ++ ;
918
920
} )
919
921
. catch ( ( error ) => {
0 commit comments