fix: sync typed-nil dependency validation

This commit is contained in:
A 2026-07-22 16:09:27 +08:00
parent 401a8f148e
commit 6e49d83fee
4 changed files with 111 additions and 1 deletions

View file

@ -854,7 +854,7 @@ func run(logger *zap.Logger) error {
EphemeralPush: ephemeralStore,
EphemeralReports: ephemeralReportStore,
Users: usersService,
TelegramLogin: telegramLoginService,
TelegramLogin: telegramLoginRPCDependency(telegramLoginService),
Updates: updatesService,
BootstrapUpdates: bootstrapUpdateStore,
BotAPIUpdates: botAPIUpdateStore,
@ -1047,6 +1047,17 @@ func run(logger *zap.Logger) error {
return srv.ListenAndServe(ctx, cfg.ListenAddr)
}
// telegramLoginRPCDependency preserves a disabled Telegram Login service as a
// nil interface. Assigning the nil *Service directly to rpc.Deps would create a
// non-nil interface with a nil concrete pointer and bypass Router availability
// checks.
func telegramLoginRPCDependency(service *telegramloginapp.Service) rpc.TelegramLoginService {
if service == nil {
return nil
}
return service
}
func runTelegramLoginRetention(ctx context.Context, service *telegramloginapp.Service, retention, interval time.Duration, batch int, logger *zap.Logger) {
run := func() {
var total int64