IOS app crashes after sending request (object releases) - dealloc

I am new Obj_c, cant understand the stack traces, which i found during the crash:
i simply send a request to server but before receiving the response app crashes.
Anybody can help me plz!!

Related

RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined Forge App

I am building a 3-legged OAuth Forge application using Visual Studio Code and Node.js. Once I start debugging, the server is listening on http://localhost:3000, but after signing in, I am getting this error message and cannot see Forge Viewer. What is the reason?
Error screenshot
The error you're seeing is most likely a "side effect" of another issue in your code. It looks like the server code is failing for some reason, and when the server tries to send back the generic error response to the client, it does not know what status code to include in the response.
Consider stepping through the authentication code in your Node.js server to narrow down the actual code that's causing the issue.

gRPC response not getting sent to client inside setTimeout when running in renderer process in electron

I am using the #grpc/grpc-js module and I have setup a sample gRPC server:
When I run a gRPC server in electron, if I send a response after a "timeout", then the response is not going to the client at all. It's not closing the http2 stream properly. The same server works fine when run in node directly but giving this issue when run through electron.
The issue doesn't happen if I send the response directly outside the timeout function.
Sample Minimal Project which demonstrates the issue:
https://github.com/nateshmbhat/grpc-with-electron-sample-project
Expected Behavior
When the gRPC server sends the response with or without the timeout, the response should reach the client and the associated streams should close properly.
Actual Behavior
Though the server sends the response, the response is not reaching the client. So, the connection and stream don't close.
I have also filed issues for this here:
https://github.com/electron/electron/issues/26838
https://github.com/grpc/grpc-node/issues/1645

Handling slow requests in NodeJs

For a single request, we can monitor its response time by using consol.log(start) at the beginning of request and console.log(end) at the point where the response is sent.
I want in the event that any request to API hangs for a long period (greater than 5-10s), I should be able to terminate the request, return an error, and log both the request and the stack trace.
How can I be able to do it at the app-level rather than for adding this console.log for each request?
On the server, I do have Nginx.

Server Side JS SDK fails to flag user

I have a webhook that runs on message save and message update. I do some basic bad word filtering. I can update the message to filter out bad words. However, when I attempt to flag the message, I get an error. Has anyone seen anything like this? How have you worked around it?
The code:
client.flagMessage(message.id).then(r => console.log('flagged message', r))
I have verified that client works as I am able to update the message with client in the same Promise.all() call.
The error:
Flag failed with error: "either user or user_id must be provided when using server side auth."
Version:
"stream-chat": "^1.7.4"
The docs:
https://getstream.io/chat/docs_rest/#flag
https://github.com/GetStream/stream-chat-js/blob/master/src/client.js#L1227
It seems very similar to this closed issue:
https://github.com/GetStream/stream-chat-js/issues/113
This might not be a proper answer but definitely is a resolution for your problem.
If setUser is called on the client then server will be able to get the flagging user from the JWT (client side auth) but in server side auth, there is no user passed to server so you get the expected error message.
You check REST docs and as seen, server supports it where JS client lacks this server side support. This a missing feature bug from JS client. It's reported to be extended as soon as possible.

How to handle errors in node.js

I know that in node, I can use process.on('UncaughtException',evtHandlerFunction(){/*code*/}); but how do I go about handling errors "properly"? Like, whenever there's an error, send out a status code 500 on the current response stream of the request that the error occured when responding to and tell the user there was a problem. But I can't seem to figure out a good way to do this. How would I go about figuring out what the "current response stream" is, for example? I just want a concept of how to do this, I don't necessarily need code. Sorry if I was unclear, please post a comment if you don't understand.
it totally depends on what kind of errors u want to handle.....
server errors can be http errors, socket errors, net errors etc.
each of these modules have an error handling code
eg:
a socket server object has:
socket.on('error',function(err)
{
//code to handle
});
check out the detailed doc on site nodejs.org
then u can use the response object as:
response.writeHead('500',{'Content_type':'text/plain'});
response.end('Your Error Message');
'your error message' will be the responseText for the client browser

Resources