File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
packages/service-core/src/api Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @powersync/service-core ' : patch
3
+ ---
4
+
5
+ Moved tag variable initialization in diagnostics route to ensure it is initialized before usage
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ export async function getSyncRulesStatus(
53
53
} ;
54
54
}
55
55
56
+ const sourceConfig = await apiHandler . getSourceConfig ( ) ;
57
+ // This method can run under some situations if no connection is configured yet.
58
+ // It will return a default tag in such a case. This default tag is not module specific.
59
+ const tag = sourceConfig . tag ?? DEFAULT_TAG ;
56
60
const systemStorage = live_status ? bucketStorage . getInstance ( sync_rules ) : undefined ;
57
61
const status = await systemStorage ?. getStatus ( ) ;
58
62
let replication_lag_bytes : number | undefined = undefined ;
@@ -128,15 +132,12 @@ export async function getSyncRulesStatus(
128
132
} )
129
133
) ;
130
134
131
- const sourceConfig = await apiHandler . getSourceConfig ( ) ;
132
- const tag = sourceConfig . tag ?? DEFAULT_TAG ;
133
-
134
135
return {
135
136
content : include_content ? sync_rules . sync_rules_content : undefined ,
136
137
connections : [
137
138
{
138
139
id : sourceConfig . id ?? DEFAULT_DATASOURCE_ID ,
139
- tag : sourceConfig . tag ?? DEFAULT_TAG ,
140
+ tag : tag ,
140
141
slot_name : sync_rules . slot_name ,
141
142
initial_replication_done : status ?. snapshot_done ?? false ,
142
143
// TODO: Rename?
You can’t perform that action at this time.
0 commit comments