File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff Large diffs are not rendered by default.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 4848end 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.
5254sub runRegistryUserMigrations(targetSections = invalid as dynamic)
5355 regSections = invalid
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
You can’t perform that action at this time.
0 commit comments