-
Notifications
You must be signed in to change notification settings - Fork 5
Add NetSuite for network tasks #105
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
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a new NetSuite autoload singleton implementing an HTTP request helper with DEFAULT_HTTP_AUTO_FREE, an http_request(...) API, per-request lifecycle tracking, a _process loop to cancel/free requests, a UID file, and a project.godot autoload registration. CHANGELOG updated. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant NetSuite as NetSuite (Autoload)
participant Req as HTTPRequest
participant Client as HTTPClient
Caller->>NetSuite: http_request(callback, request, downloadfile, auto_free_on)
activate NetSuite
NetSuite->>Req: instantiate & configure (method, headers, body, downloadfile)
NetSuite->>Req: connect "request_completed" -> callback
NetSuite->>NetSuite: store Req -> http_requests[Req] = auto_free_on
NetSuite->>Req: add_child, start request
NetSuite-->>Caller: return Req
deactivate NetSuite
loop every frame (_process)
NetSuite->>Req: inspect Req.get_http_client().get_status()
alt status in auto_free_on
NetSuite->>Req: cancel() / remove from parent / queue_free()
Note right of NetSuite: untrack from http_requests
else
Note right of NetSuite: no action
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
CHANGELOG.md (1)
14-14: Clarify the new API in the changelog entry.Briefly mention the public function signature to help integrators discover usage, e.g., “NetSuite.http_request(callback := Callable(), request := {}, downloadfile := "", auto_free_on := DEFAULT_HTTP_AUTO_FREE)”.
core/autoload/net_suite.gd (1)
2-2: Fix typos and misleading docs (“works/optioanl/intiailize/insted/rquest”; ‘when "url" is true/false’).Clean up wording to prevent misuse.
Apply:
-## Helper class for network works. +## Helper for network tasks. @@ -## Creates new [HTTPRequest] and intiailize it with this optioanl parameters:[br] -## َ - [param callback]: [Callable] to connect to [signal HTTPRequest.request_completed].[br] -## َ - [param request]: Optional request to send, with these keys:[br] -## َ - [code]"url"[/code]: URL to send request.[br] -## َ - [code]"raw"[/code] (Optional, default is [code]false[/code]): Uses [method HTTPRequest.request_raw] insted of [method HTTPRequest.request] if [code]true[/code].[br] -## َ - [code]"custom_headers"[/code] (Optional, default is empty [PackedStringArray]): Custom headers to send request.[br] -## َ - [code]"method"[/code] (Optional, default is [constant HTTPClient.METHOD_GET]): Request method.[br] -## َ - [code]"request_data_raw"[/code] (Optional, default is empty [PackedByteArray]): Data to send in rquest when [code]"url"[/code] is [code]true[/code].[br] -## َ - [code]"request_data"[/code] (Optional, default is empty [String]): Data to send in rquest when [code]"url"[/code] is [code]false[/code] (default).[br] -## َ - [param downloadfile]: The file to download into.[br] -## َ - [param auto_free_on]: An [Array] of [enum HTTPClient.Status]es that will free this request.[br][br] +## Creates a new [HTTPRequest] and initializes it with these optional parameters:[br] +## - [param callback]: [Callable] to connect to [signal HTTPRequest.request_completed].[br] +## - [param request]: Optional request data with keys:[br] +## - [code]"url"[/code]: URL to request.[br] +## - [code]"raw"[/code] (Optional, default [code]false[/code]): Use [method HTTPRequest.request_raw] instead of [method HTTPRequest.request] when [code]true[/code].[br] +## - [code]"custom_headers"[/code] (Optional, default empty [PackedStringArray]): Custom headers.[br] +## - [code]"method"[/code] (Optional, default [constant HTTPClient.METHOD_GET]): Request method.[br] +## - [code]"request_data_raw"[/code] (Optional, default empty [PackedByteArray]): Binary body when using [code]"raw"[/code].[br] +## - [code]"request_data"[/code] (Optional, default empty [String]): String body when not using [code]"raw"[/code].[br] +## - [param downloadfile]: Target file path for downloads.[br] +## - [param auto_free_on]: [Array] of [enum HTTPClient.Status] values; when matched, the request is canceled and freed.[br][br]Also applies to: 27-38
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
CHANGELOG.md(1 hunks)core/autoload/net_suite.gd(1 hunks)core/autoload/net_suite.gd.uid(1 hunks)project.godot(1 hunks)
🔇 Additional comments (2)
core/autoload/net_suite.gd.uid (1)
1-1: UID file looks fine.No issues.
project.godot (1)
40-40: Autoload registration LGTM; confirm ordering assumptions.If NetSuite ever depends on other autoloads, ensure it’s listed after them.
Type of Change
Description
Add a new
NetSuiteautoload that will handle network tasks in simpler way. Currently supports HTTP requests with complete options.Testing
Works fine with all parameters.
Impact
Nothing
Additional Information
Nothing
Checklist
Summary by CodeRabbit
New Features
Documentation
Chores