Skip to content

[Clean/Refactor]: Simplify iOS background check #3611

@ozudev

Description

@ozudev

The issue

In internal/msggateway/hub_server.go, the pushToUser function has this check:

  if !client.IsBackground || (client.IsBackground && client.PlatformID != constant.IOSPlatformID) { ... }

It's like saying “not background OR (background AND not iOS)” which is hard to follow.

The code should just say “if the client is background AND iOS, skip the push”:

if client.IsBackground && client.PlatformID == constant.IOSPlatformID {

and push for everyone else in the same way as today.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    otherIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions