Alexander Stolte Expert Licensed User Longtime User Nov 5, 2020 #1 I have the following code: B4X: Copy Dim url As String = $"https://identitytoolkit.googleapis.com/v1/accounts:resetPassword?key=${API_KEY}"$ Dim json As JSONGenerator json.Initialize(CreateMap("oobCode":oobCode)) Dim j As HttpJob : j.Initialize("",Me) j.PostString(url,json.ToString) j.GetRequest.SetContentType("application/json") Wait For (j) JobDone(j As HttpJob) If i run it local on my pc it works as expected, but if i run it on my VPS then the following error message is returned by Firebase: B4X: Copy ResponseError. Reason: , Response: { "error": { "code": 400, "message": "MISSING_OOB_CODE", "errors": [ { "message": "MISSING_OOB_CODE", "domain": "global", "reason": "invalid" } ] } } The crazy thing is, it happens only every 2-4 times, sometimes more than once in a row, but in the logging I see that the data that is transmitted is always the right one. OS: Ubuntu 20.04 (64 Bit) non-ui Has anyone ever had these problems on a server?
I have the following code: B4X: Copy Dim url As String = $"https://identitytoolkit.googleapis.com/v1/accounts:resetPassword?key=${API_KEY}"$ Dim json As JSONGenerator json.Initialize(CreateMap("oobCode":oobCode)) Dim j As HttpJob : j.Initialize("",Me) j.PostString(url,json.ToString) j.GetRequest.SetContentType("application/json") Wait For (j) JobDone(j As HttpJob) If i run it local on my pc it works as expected, but if i run it on my VPS then the following error message is returned by Firebase: B4X: Copy ResponseError. Reason: , Response: { "error": { "code": 400, "message": "MISSING_OOB_CODE", "errors": [ { "message": "MISSING_OOB_CODE", "domain": "global", "reason": "invalid" } ] } } The crazy thing is, it happens only every 2-4 times, sometimes more than once in a row, but in the logging I see that the data that is transmitted is always the right one. OS: Ubuntu 20.04 (64 Bit) non-ui Has anyone ever had these problems on a server?
Erel B4X founder Staff member Licensed User Longtime User Nov 5, 2020 #2 Are you making multiple connections at once? Better to set the relevant handler to be a single thread handler. Upvote 0
Are you making multiple connections at once? Better to set the relevant handler to be a single thread handler.
Alexander Stolte Expert Licensed User Longtime User Nov 5, 2020 #3 Erel said: Are you making multiple connections at once? Click to expand... In live mode yes, but in my test locally and then on the server I am the only one who has only made one request. Erel said: Better to set the relevant handler to be a single thread handler. Click to expand... Let me try it out. Upvote 0
Erel said: Are you making multiple connections at once? Click to expand... In live mode yes, but in my test locally and then on the server I am the only one who has only made one request. Erel said: Better to set the relevant handler to be a single thread handler. Click to expand... Let me try it out.
Alexander Stolte Expert Licensed User Longtime User Nov 5, 2020 #4 Erel said: Better to set the relevant handler to be a single thread handler. Click to expand... I test it 4 times without any errors. What disadvantages does the service have now that it is single thread? Upvote 0
Erel said: Better to set the relevant handler to be a single thread handler. Click to expand... I test it 4 times without any errors. What disadvantages does the service have now that it is single thread?
Erel B4X founder Staff member Licensed User Longtime User Nov 5, 2020 #5 I'm not sure that it is related to this error. You will need to make more tests. It means that each connection, to this handler, will be handled sequentially. If the firebase server responds fast enough then it shouldn't be an issue. Upvote 0
I'm not sure that it is related to this error. You will need to make more tests. It means that each connection, to this handler, will be handled sequentially. If the firebase server responds fast enough then it shouldn't be an issue.
Alexander Stolte Expert Licensed User Longtime User Nov 7, 2020 #6 Erel said: I'm not sure that it is related to this error. You will need to make more tests. Click to expand... After some tests with several devices, I can say that this was the reason. As soon as I switch the MutliThread Handler again the errors come back. I execute the code in a different class than the handler and wait for the result, can this be the error? Upvote 0
Erel said: I'm not sure that it is related to this error. You will need to make more tests. Click to expand... After some tests with several devices, I can say that this was the reason. As soon as I switch the MutliThread Handler again the errors come back. I execute the code in a different class than the handler and wait for the result, can this be the error?
Erel B4X founder Staff member Licensed User Longtime User Nov 8, 2020 #7 Alexander Stolte said: I execute the code in a different class than the handler and wait for the result, can this be the error? Click to expand... Yes. The class "owner thread" is different so you must take more care when calling back and forth. Upvote 0
Alexander Stolte said: I execute the code in a different class than the handler and wait for the result, can this be the error? Click to expand... Yes. The class "owner thread" is different so you must take more care when calling back and forth.