Warn before silently attributing every author to the importing admin on account-less exports #561
Labels
No labels
antville.org
bug
compatibility
dependency
duplicate
enhancement
help wanted
invalid
java
javascript
major
needs feedback
needs work
no-issue-activity
runtime
security
urgent
usability
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
antville/antville#561
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while running the real-MariaDB verification pass for the site/account importer rewrite (#557-#560).
Importer.makeAccountResolver(code/Global/Importer.jsaround line 257-278) resolves each old creator id againstaccountMap, built from the export'saccounts.json. When an export has noaccounts.jsonat all — true for every export produced before the cross-instance account-resolution work landed —accountMapis empty, so every single lookup falls through to the finalelsebranch and returnsfallbackUser(the admin performing the import), not a placeholder:This is arguably the only thing the code can do in that case — there's no name data at all to label a placeholder with, since
accounts.jsonis what carriesid -> name. But it means every distinct original author's stories/comments/etc. get silently collapsed onto whoever runs the import.Worse, this is invisible at review time.
Importer.preview's report only lists rows that exist inaccountMap, so when the map is empty there's nothing to show — no "unresolved" table, no count, nothing distinguishing this from a completely clean import. Compare with a tampered/foreign-machine export (accounts.json present but non-matching), which correctly shows "0 authors matched automatically" plus a per-account "No matching account found" row with an override field.Verified via a live test on antville-test.de: exported a fixture site, then re-uploaded a copy with
accounts.jsonremoved andexportKeystripped fromindex.json. Preview showed only "0 authors matched automatically" with no unresolved-accounts table at all. After confirming, every story and comment (originally attributed to a distinct test account) ended up attributed to the importing admin account instead, with no error or warning anywhere in the flow.Suggested fix: when
accountMapis empty (or whenImporter.previewdetects the export predatesaccounts.json, e.g.index.jsonhas noexportKey), surface an explicit warning in the review screen — something like "This export has no author data; all content will be attributed to your account" — so the admin makes an informed choice instead of this happening silently.