[bug] Client created with same client ID or device token but different tenant ID will break association with notifications
Client created with same client ID or device token, but under different tenant will update the tenant ID of the client but not delete any associated notifications with the old tenant ID. Notifications are always queried by their tenant ID vs clients are not.
Two solutions:
- Remove tenant_id column from notifications and use the tenant_id column of the clients table (if this is even needed at all)
- Update the tenant_id or delete notifications when the client's tenant_id changes
E.g. happening in real world: https://walletconnect.slack.com/archives/C04DB2EAHE3/p1716951454311359?thread_ts=1716951454.311359&cid=C04DB2EAHE3
Client created with same client ID or device token, but under different tenant will update the tenant ID of the client but not delete any associated notifications with the old tenant ID. Notifications are always queried by their tenant ID vs clients are not.
Two solutions:
- Remove tenant_id column from notifications and use the tenant_id column of the clients table (if this is even needed at all)
- Update the tenant_id or delete notifications when the client's tenant_id changes
Client created with same client ID or device token, but under different tenant will update the tenant ID of the client but not delete any associated notifications with the old tenant ID. Notifications are always queried by their tenant ID vs clients are not.
Two solutions:
- Remove tenant_id column from notifications and use the tenant_id column of the clients table (if this is even needed at all)
- Update the tenant_id or delete notifications when the client's tenant_id changes