Skip to content

Commit 78fbf44

Browse files
committed
Update code docs
1 parent e557711 commit 78fbf44

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

docs/data/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-migrations.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/source_migrations.bs.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
end sub
4949

5050
' Run registry migrations for user sections
51+
' Only processes sections with a valid serverId key (written by user.Login())
52+
' Automatically skips orphaned/incomplete sections and global sections
5153
' @param targetSections Optional array of specific section names to migrate. If invalid, migrates all sections.
5254
sub runRegistryUserMigrations(targetSections = invalid as dynamic)
5355
regSections = invalid
@@ -84,11 +86,22 @@
8486

8587
' Process this section
8688
reg = CreateObject("roRegistrySection", section)
89+
90+
' Validate this is a legitimate user section by checking for serverId
91+
' serverId is ALWAYS written by user.Login() regardless of saveCredentials
92+
' If missing, this is an orphaned/incomplete section - skip it
93+
if not reg.exists("serverId")
94+
print `Skipping incomplete user section: ${section} (missing serverId)`
95+
continue for
96+
end if
97+
98+
' Check if user needs migrations
8799
lastRunVersion = invalid
88100
if reg.exists("LastRunVersion")
89101
lastRunVersion = reg.read("LastRunVersion")
90102
else
91-
' No LastRunVersion found, assume very old version
103+
' No LastRunVersion found - could be old user data needing migration
104+
' Use "0.0.0" to trigger all migrations (safe since migrations are idempotent)
92105
lastRunVersion = "0.0.0"
93106
reg.write("LastRunVersion", lastRunVersion)
94107
end if

0 commit comments

Comments
 (0)