Conversation
Greptile SummaryThis PR updates the Ruby SDK to version 24.0.0, introducing three new services (
Confidence Score: 3/5The new services and model additions are structurally sound, but two enum duplication issues in appwrite.rb and the post-gsub nil check ordering in the new services need to be resolved before release. The duplicate enum pairs (Scopes/ProjectKeyScopes and OAuth2GooglePrompt/ProjectOAuth2GooglePrompt) expose contradictory API surface after the intended rename, and nil guards in the new Advisor and Presences service methods fire after the gsub call that would already raise a TypeError on nil input, hiding the intended error message. lib/appwrite.rb (duplicate enum requires), lib/appwrite/services/advisor.rb and lib/appwrite/services/presences.rb (post-gsub nil checks) Important Files Changed
|
| @@ -276,6 +292,7 @@ | |||
| require_relative 'appwrite/enums/deployment_status' | |||
| require_relative 'appwrite/enums/execution_trigger' | |||
| require_relative 'appwrite/enums/execution_status' | |||
| require_relative 'appwrite/enums/o_auth2_google_prompt' | |||
There was a problem hiding this comment.
Duplicate
OAuth2GooglePrompt and ProjectOAuth2GooglePrompt enum modules
Both Enums::ProjectOAuth2GooglePrompt (line 270, project_o_auth2_google_prompt.rb) and Enums::OAuth2GooglePrompt (line 295, o_auth2_google_prompt.rb) are new files introduced in this PR with identical values (NONE, CONSENT, SELECT_ACCOUNT). The PR description only mentions ProjectOAuth2GooglePrompt. One of these should be removed — having both registers two identical, ambiguously named constants in the Appwrite::Enums namespace.
| def get_report(report_id:) | ||
| api_path = '/reports/{reportId}' | ||
| .gsub('{reportId}', report_id) | ||
|
|
||
| if report_id.nil? | ||
| raise Appwrite::Exception.new('Missing required parameter: "reportId"') | ||
| end |
There was a problem hiding this comment.
Nil check occurs after path interpolation
The guard if report_id.nil? on line 50 is unreachable when report_id is nil because Ruby's String#gsub raises a TypeError: no implicit conversion of nil into String during the .gsub('{reportId}', report_id) call on line 48. The caller therefore receives a cryptic TypeError instead of the intended Appwrite::Exception message. The nil check should precede the path-building step. The same ordering issue exists in delete_report, list_insights, and get_insight in this file, and in presences.rb for get, upsert, update_presence, and delete.
This PR contains updates to the Ruby SDK for version 24.0.0.
What's Changed
AuthMethodenum toProjectAuthMethodIdEmailTemplateTypetoProjectEmailTemplateIdandEmailTemplateLocaletoProjectEmailTemplateLocaleServiceIdtoProjectServiceId,ProtocolIdtoProjectProtocolId,SecuretoProjectSMTPSecure,ProjectPolicytoProjectPolicyIdScopesenum withProjectKeyScopesfor project key endpointsProject#update_deny_canonical_email_policy; replaced withupdate_deny_aliased_email_policy,update_deny_disposable_email_policy, andupdate_deny_free_email_policyAuthProvidermodel; use newProjectOAuthProviderIdenum insteadProject#getmethod to fetch current project detailsAdvisor,Presences, andUsageservicesInsight,Presence,Report,UsageEvent, andUsageGaugemodels with list variantsProjectAuthMethod,ProjectProtocol, andProjectServicemodelsProjectOAuthProviderIdandProjectOAuth2GooglePromptenumsProject,Database, andOAuth2Googlemodel schemasX-Appwrite-Response-Formatheader to1.9.5