fix(hosts): carry an inbound update's externalProxy change onto its imported hosts (#6831)

Subscriptions build an inbound's links from its Host rows, and those rows are
imported from streamSettings.externalProxy only when the inbound is added. An
update that moved the external proxy returned 200, but every subscription kept
handing out the old address, port and security.

An update now re-syncs only the externalProxy entries it changed onto hosts that
are still exactly as imported. Unchanged entries are set aside first, so a host
the admin edited, disabled, deleted or shared is never re-imported next to the
admin's version, and a stream without the externalProxy key leaves hosts alone.
This commit is contained in:
Farhan Zare
2026-10-23 22:20:50 -04:00
committed by GitHub
parent d50c419e28
commit 3acdfd9dea
3 changed files with 458 additions and 17 deletions
+3
View File
@@ -2047,6 +2047,9 @@ func (s *InboundService) UpdateInbound(inbound *model.Inbound) (*model.Inbound,
if err := s.updateClientTraffics(tx, oldInbound, inbound); err != nil {
return err
}
if err := database.SyncHostsFromExternalProxy(tx, inbound.Id, running.StreamSettings, inbound.StreamSettings); err != nil {
return err
}
// Ensure created_at and updated_at exist in inbound.Settings clients
{