uniqush / uniqush-push

Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.
http://uniqush.org
Apache License 2.0
1.53k stars 201 forks source link

Update AddPushServiceProviderToService method to prevent duplicate se… #198

Closed victorlang closed 5 years ago

victorlang commented 6 years ago

Currently, one service is allowed to have multiple psp during ADDPSP. Notice there is comment mentioned that it's a feature to allow single service has multiple psp in different push service type. Unfortunately, sometimes a user might add a service psp in same push service type, since there is no warning message for that, under this situation, no one even know there are multiple service<->psp pair in same push service type, and only the very first one returned in getting service will be working in runtime. That will cause trouble in subscribe and push operation. It results in some issues and hard to discover the root cause. So introducing this fix to prevent a user to add redundant service<->psp in same push service type.
One method AddPushServiceProviderToService(...) in pushdb.go is updated to fix this issue. And psp in different push service type is still allowed to add under the same service.

victorlang commented 6 years ago

link to issue #197

TysonAndre commented 5 years ago

201 (the newer version of this PR) has been merged with patches

See https://github.com/uniqush/uniqush-push/commits/cfc71ea4b9f90dc0f149a7ad62d4c0cd8ff6ce9f