Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendAll sets success to true even if there are warnings and errors #6

Open
macMikey opened this issue Jan 13, 2022 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@macMikey
Copy link

Sometime after b27545f (I have not read through the code to see where, yet), push .sendAll can both set success to true while returning both errors and warnings, and the notification failing.

@macMikey
Copy link
Author

macMikey commented Jan 13, 2022

In 19.1, everything works as expected. In 18R4, no.

@mesopelagique
Copy link
Contributor

I will try to analyse the code (not mine)

If there is some issue with email or token passed
warning could occurs https://github.com/4d-go-mobile/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/Mobile%20App%20Push%20Notification.4dm#L57
but we go on

then if one push has been sent with success I see that success is set to True and warning are added for failures
https://github.com/4d-go-mobile/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/Mobile%20App%20Push%20Notification.4dm#L113
comments see a choice have been made to do that

(have different behaviour could be discussed, like stop at first failure, or set False if one failure, maybe return all result for each notification!)

@mesopelagique mesopelagique added the enhancement New feature or request label Jan 17, 2022
@macMikey
Copy link
Author

I saw that in the code, that success is supposed to mean that at least one message makes it through, but what I experienced was that even if all fail (which is what I was finding, because my session filenames were not email addresses), I can get a success. Since R4 compiled isn't behaving the same as interpreted, or at least as what's at the R4 tag in the repo, I can't reproduce the behavior in interpreted and offer some assistance in diagnosing it.
Maybe warning should be for messages that 4D transmits but only after it had to fix something, like discarding the badge because it was not a number. I don't think APNS will accept any malformed messages.

@mesopelagique
Copy link
Contributor

mesopelagique commented Jan 17, 2022

My first analyse was limited to Mobile App Push Notification, and suppose that next command do the job correctly

This method call apple_sendNotification that return success
if the call of LAUNCH EXTERNAL PROCESS with curl has no output
https://github.com/4d-go-mobile/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/apple_sendNotification.4dm#L53
(4D do not return process exit code with LAUNCH EXTERNAL PROCESS, so it's a little tricky)
I will ask about it

(maybe it a change in option like --verbose or curl behaviour change , maybe loging $cmdPush and launching the command in internal could help, see if error are in system out or in system err)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants