Skip to content

feat: Add LastRequestExecuting event in resumable upload#2

Open
mahendra-google wants to merge 2 commits into
mainfrom
feat/upload-last-request-event
Open

feat: Add LastRequestExecuting event in resumable upload#2
mahendra-google wants to merge 2 commits into
mainfrom
feat/upload-last-request-event

Conversation

@mahendra-google
Copy link
Copy Markdown
Owner

  • Add tests to ensure that event is triggered once in single chunk and multichunk upload

- Add tests to ensure that event is triggered once in single chunk and multichunk upload
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new LastRequestExecuting event to the ResumableUpload class, which is triggered when the final chunk of data is uploading. It also adds corresponding unit tests to verify the event's behavior in both single-chunk and multi-chunk upload scenarios. The review feedback suggests correcting a minor grammatical typo in the event's XML documentation and splitting two statements onto separate lines in the multi-chunk test file to improve readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +209 to +211
/// <summary>
/// Event called when the final chunk of a data is uploading.
/// </summary>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a minor grammatical typo in the XML documentation: 'final chunk of a data' should be 'final chunk of data' or 'final chunk of the data'.

        /// <summary>
        /// Event called when the final chunk of data is uploading.
        /// </summary>

using (var service = new MockClientService(server.HttpPrefix))
{
var content = knownSize ? new MemoryStream(UploadTestBytes) : new UnknownSizeMemoryStream(UploadTestBytes);
var uploader = new TestResumableUpload(service, "MultiChunk", "POST", content, "text/plain", chunkSize); int eventInvokeCount = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and adherence to standard C# coding conventions, avoid placing multiple statements on a single line. Please split the uploader initialization and the eventInvokeCount declaration into separate lines.

                var uploader = new TestResumableUpload(service, "MultiChunk", "POST", content, "text/plain", chunkSize);
                int eventInvokeCount = 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant