Device tracker from mqtt change status to not home after HA restart

Is this expected?
My GPS device tracker will keep status after HA restart.
But the mqtt device tracker will show not home after HA restart and chang back until receive the mqtt payload.

The retain flag has to be set when publishing the mqtt tracker payload. This is then stored in the broker and any clients (like home assistant) will be sent the payload when they connect (or reconnect).