feat: Ruby SDK update for version 25.0.0#65
Conversation
Greptile SummaryThis PR updates the Ruby SDK to version 25.0.0, introducing the new
Confidence Score: 4/5Safe to merge after fixing the StatusCode constant names — all other changes are additive or straightforward renames. The StatusCode constants MOVEDPERMANENTLY, TEMPORARYREDIRECT, and PERMANENTREDIRECT lost their internal underscores instead of only the numeric suffix, making them non-idiomatic and inconsistent with every other multi-word constant in the SDK. Any consumer referencing these constants by name will need to use the awkward concatenated form, and the rename diverges from what the PR description advertised. Everything else looks correct. lib/appwrite/enums/status_code.rb Important Files Changed
Reviews (2): Last reviewed commit: "chore: merge main and resolve version co..." | Re-trigger Greptile |
| upload_complete = lambda do |chunk_result| | ||
| chunks_uploaded = chunk_result['chunksUploaded'] | ||
| return false if chunks_uploaded.nil? | ||
|
|
||
| on_progress.call({ | ||
| id: result['$id'], | ||
| progress: ([offset, size].min).to_f/size.to_f * 100.0, | ||
| size_uploaded: [offset, size].min, | ||
| chunks_total: result['chunksTotal'], | ||
| chunks_uploaded: result['chunksUploaded'] | ||
| }) unless on_progress.nil? | ||
| chunks_total = chunk_result['chunksTotal'] || total_chunks | ||
| chunks_uploaded.to_i >= chunks_total.to_i | ||
| end |
There was a problem hiding this comment.
The
upload_complete lambda assigns to chunks_uploaded, which is the same variable captured from the outer scope (Ruby lambdas close over variables by reference). This silently mutates the outer chunks_uploaded on every invocation — once from the main thread after the first chunk, then repeatedly from worker threads inside mutex.synchronize. While the outer variable isn't read again after the workers start, this is unintentional aliasing that makes the code fragile to future edits. Using a distinct local name keeps the intent clear.
| upload_complete = lambda do |chunk_result| | |
| chunks_uploaded = chunk_result['chunksUploaded'] | |
| return false if chunks_uploaded.nil? | |
| on_progress.call({ | |
| id: result['$id'], | |
| progress: ([offset, size].min).to_f/size.to_f * 100.0, | |
| size_uploaded: [offset, size].min, | |
| chunks_total: result['chunksTotal'], | |
| chunks_uploaded: result['chunksUploaded'] | |
| }) unless on_progress.nil? | |
| chunks_total = chunk_result['chunksTotal'] || total_chunks | |
| chunks_uploaded.to_i >= chunks_total.to_i | |
| end | |
| upload_complete = lambda do |chunk_result| | |
| uploaded = chunk_result['chunksUploaded'] | |
| return false if uploaded.nil? | |
| chunks_total = chunk_result['chunksTotal'] || total_chunks | |
| uploaded.to_i >= chunks_total.to_i | |
| end |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| end | ||
| end | ||
| end No newline at end of file |
This PR contains updates to the Ruby SDK for version 25.0.0.