In my application, I get a lot of these errors.
Error REST из apple wallet [2019-07-19 10:51:29 +0300] Web service
error for myOwnPassTypeIdentifier (https://webServiceURL): Device
received spurious push. Request for passesUpdatedSince
'30657301263000' returned no serial numbers. (Device = ....)
And also
Error REST из apple wallet [2019-07-19 12:43:33 +0300] Web service
error for myOwnPassTypeIdentifier (https://webServiceURL): Server
ignored the 'if-modified-since' header (Fri, 19 Jul 2019 09:43:14 GMT)
and returned the full unchanged pass data for serial number
'2222000174317170'.
How can I avoid them, hot to heal ? )
For preventing that error I had to send a correct date as last modified tag with Response in /passes/{passTypeIdentifier}/{serialNumber} method with prepared Pass and also in /devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier} with corrected SerialNumbers
I got a correct date from DB and push it to Response. So, any modification,firstly updated DB, then I send push to APNs and got Request to update pass, where I had last modified from the previous Request which I compare with actual date in my DB.
Related
I have a DB in which I saved a list of message that I have to send using firebase cloud messaging.
If I want to send up to 100 messages in batch for better efficient how can I understand which of the message in my db was sended correctly and which one give me an error?
I have seen that the response are something like this for the error response:
error: {"error":{"code":400,"message":"Invalid condition expression provided.","status":"INVALID_ARGUMENT","details":[{"#type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"field":"message.condition","description":"Invalid condition expression provided."}]},{"#type":"type.googleapis.com/google.firebase.fcm.v1.FcmError","errorCode":"INVALID_ARGUMENT"}]}}
for the message accepted we have something like this:
id: projects/id_project/messages/0:1563809489349852%31bd1c9631bd1c96
How can I understand which message had an error so I can try to send it again or handle that error. Moreover I want to understand even which message was sended correctly.
any advice?
Thanks in advance.
The order of the responses corresponds to the order of the input messages in a batch. From the API docs of the Java Admin SDK:
The responses list obtained by calling getResponses() on the return value corresponds to the order of input messages.
Same is true for other implementations of the Admin SDK that supports FCM batch messaging.
A client sends a request and catches a timeout exception. However the server is still processing the request and saving it to the database. Before that happening, the client already sent a second request which doubles the record on the database. How do I prevent that from happening? Im using java servlets and javascript.
A few suggestions:-
1) Increase the client timeout.
2) Make the server more efficient so it can respond faster.
3) Get the server to respond with an intermediate "I'm working on it" response before returning with the main response.
4) Does the server need to do all the work before it responds to the client, or can some be offloaded to a seperate process for running later?
A client sends a request and catches a timeout exception. However the server is still processing the request
Make the servlet generate some output (can be just blank spaces) and flush the stream every so often (every 15 seconds for example).
If the connection has been closed on the client side, the write will fail with a socket exception.
Before that happening, the client already sent a second request which doubles the record on the database
Use the atomicity of the database, for example, a unique key. Start the process by creating a unique record (maybe in some "unfinished" status), it will fail if the record already exists.
I am trying to access Yahoo mail with IMAP using JavaMail API. I can connect to the Yahoo mail server successfully and am able to fetch the messages using folder.getMessages() call where folder is an object of javax.mail.Folder class.
I need to iterate over all the messages returned by this call and I fetch received date of each message in this iteration. The iteration works well for small number of messages as it does not takes a long time, however if the number of returned messages is large (say around 10000) and iteration takes more than 30 minutes, then following exception occurs after 30 minutes:
javax.mail.FolderClosedException: * BYE IMAP4rev1 Server logging out
at com.sun.mail.imap.IMAPMessage.loadEnvelope(IMAPMessage.java:1234)
at com.sun.mail.imap.IMAPMessage.getReceivedDate(IMAPMessage.java:378)
at mypack.ImapUtils.getReceivedDate(ImapUtils.java:193)
...
Please note that I do not use the Folder object again during this iteration.
Could anyone please tell:
if there is a way to keep the folder open on yahoo mail server until it is explicitly closed?
if there is some property or setting which can be used to increase this "30 minutes" interval after which the folder is closed by the yahoo's IMAP server.
Thanks.
I am fetching the emails from the POP server.
I am using the following logic to find the mail which is received newly.
if(currentMail.getSentTime() > lastMailFetchedTime)
{
//Processing the email
}
else
{
System.out.println("Mail sent earlier. It might be fetched already");
}
At regular time interval , Some emails are missed from the POP mail fetcher(For Google Apps account). I have analyzed the mail fetching process and identified that, POP server is giving the older emails which is not given in the previous mail fetching.
Is Gmail POP server provides the mail based on the mail sent time(I am not getting it in proper order)?
If it is not given using the mail sent time means, How can I fetch the newly created emails without using IMAP ?
Think of the POP3 server as storing messages in a sequential list where the last message in the list is always the most recently received message.
So essentially it "sorts" them in order of arrival, but this might not be the same as "Date Sent".
POP3 server is automatically sorted messages, but only up to minutes.
Situation : I am coding a web service in which soap client sends the request to web service which will update the database.
Suppose, there is a table project_team_members and service will be updating info of individual team member.
There is a column in table IS_TEAM_LEADER which can have '0' or '1' as value.
Problem: When updating TL info, if I am not sending IS_TL field from SOUP UI (A SOAP Client), it is automatically received as 'false' by default in java code.
How can i know if user is sending it or not, i mean i am not able to send null in case of boolean data-type from SOAP client
Revisiting my own question after so many years.
Giving response to myself at 2012 :)
One option can be, to send whatever is there in the database as it is, back to the server. But for this prior read call is necessary.
Another option is given by Jesse's(comment under question) as an answer/solution
If there is any field, e.g. Foo, there is often an associated
IsFooSpecified property to determine if the value was set or not. If
there an IsIsTeamLeadSpecified property you can access?
PS: There wasn't any field as suggested by Jesse but this can help someone else.