Skip to content

fix(subscription): write reality sid to host_inbound, not the shared inbound dict#2036

Open
lsdgem wants to merge 1 commit intoGozargah:devfrom
lsdgem:fix/reality-sid-empty
Open

fix(subscription): write reality sid to host_inbound, not the shared inbound dict#2036
lsdgem wants to merge 1 commit intoGozargah:devfrom
lsdgem:fix/reality-sid-empty

Conversation

@lsdgem
Copy link
Copy Markdown

@lsdgem lsdgem commented Apr 25, 2026

closes #1986

host_inbound = inbound.copy() is taken before the host loop. the random shortId pick was writing to the original inbound (the shared xray.config.inbounds_by_tag[tag]), so host_inbound["sid"] stayed unset and the URL came out with empty &sid=. moving the assignment to host_inbound fixes it and stops mutating shared config along the way.

                if sids := inbound.get("sids"):
-                   inbound["sid"] = random.choice(sids)
+                   host_inbound["sid"] = random.choice(sids)

repro: restart marzban, copy any reality user's config — first copy emits empty sid=. refresh the page and copy again — sid= is now populated.

non-reality inbounds don't have sids so the branch is skipped — no behavior change there.

@lsdgem
Copy link
Copy Markdown
Author

lsdgem commented Apr 25, 2026

introduced in c5d3263 (#1490) — wrong target dict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant