File tree Expand file tree Collapse file tree 3 files changed +25
-15
lines changed Expand file tree Collapse file tree 3 files changed +25
-15
lines changed Original file line number Diff line number Diff line change @@ -153,11 +153,7 @@ export class JupyterActions extends JupyterActions0 {
153
153
}
154
154
} ) ;
155
155
156
- // Put an entry in the project log once the jupyter notebook gets opened.
157
- // NOTE: Obviously, the project does NOT need to put entries in the log.
158
- this . syncdb . once ( "change" , ( ) =>
159
- this . redux ?. getProjectActions ( this . project_id ) . log_opened_time ( this . path ) ,
160
- ) ;
156
+ this . initOpenLog ( ) ;
161
157
162
158
// project doesn't care about cursors, but browser clients do:
163
159
this . syncdb . on ( "cursor_activity" , this . syncdb_cursor_activity ) ;
@@ -176,6 +172,23 @@ export class JupyterActions extends JupyterActions0 {
176
172
}
177
173
}
178
174
175
+ initOpenLog = ( ) => {
176
+ // Put an entry in the project log once the jupyter notebook gets opened and
177
+ // shows cells.
178
+ const reportOpened = ( ) => {
179
+ if ( this . _state == "closed" ) {
180
+ return ;
181
+ }
182
+ if ( this . syncdb . get_one ( { type : "cell" } ) != null ) {
183
+ this . redux
184
+ ?. getProjectActions ( this . project_id )
185
+ . log_opened_time ( this . path ) ;
186
+ this . syncdb . removeListener ( "change" , reportOpened ) ;
187
+ }
188
+ } ;
189
+ this . syncdb . on ( "change" , reportOpened ) ;
190
+ } ;
191
+
179
192
initUsageInfo = async ( ) => {
180
193
while ( this . _state != "closed" ) {
181
194
try {
Original file line number Diff line number Diff line change @@ -1027,14 +1027,11 @@ export class SyncDoc extends EventEmitter {
1027
1027
this . assert_table_is_ready ( "syncstring" ) ;
1028
1028
this . dbg ( "set_initialized" ) ( { error, read_only, size } ) ;
1029
1029
const init = { time : this . client . server_time ( ) , size, error } ;
1030
- for ( let i = 0 ; i < 3 ; i ++ ) {
1031
- await this . set_syncstring_table ( {
1032
- init,
1033
- read_only,
1034
- last_active : this . client . server_time ( ) ,
1035
- } ) ;
1036
- await delay ( 1000 ) ;
1037
- }
1030
+ await this . set_syncstring_table ( {
1031
+ init,
1032
+ read_only,
1033
+ last_active : this . client . server_time ( ) ,
1034
+ } ) ;
1038
1035
} ;
1039
1036
1040
1037
/* List of logical timestamps of the versions of this string in the sync
@@ -1463,7 +1460,7 @@ export class SyncDoc extends EventEmitter {
1463
1460
log ( "update interest" ) ;
1464
1461
this . initInterestLoop ( ) ;
1465
1462
1466
- log ( "ensure syncstring exists in database (if not using NATS) " ) ;
1463
+ log ( "ensure syncstring exists" ) ;
1467
1464
this . assert_not_closed ( "initAll -- before ensuring syncstring exists" ) ;
1468
1465
await this . ensure_syncstring_exists_in_db ( ) ;
1469
1466
Original file line number Diff line number Diff line change 1
1
/* autogenerated by the update_version script */
2
- exports . version = 1752418521 ;
2
+ exports . version = 1752527312 ;
You can’t perform that action at this time.
0 commit comments