-
Notifications
You must be signed in to change notification settings - Fork 18
CUST-4111/CUST-4162: improve to more descriptive error response & validate event's start vs end time #300
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
Merged
googsvg
merged 7 commits into
main
from
CUST-4111-v-3-java-sdk-is-returning-bad-request-while-updating-event
Feb 4, 2026
Merged
CUST-4111/CUST-4162: improve to more descriptive error response & validate event's start vs end time #300
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7eea44d
first try
googsvg b84b4d1
comments for better readability
googsvg 43a23b1
test: add coverage for null error object fallback path
googsvg 4b07505
address gradle.kts comments
googsvg cc4663c
set target compatibility to 1.8
googsvg ff38989
more backward compatible error response, but still useful message
googsvg 3facf8c
fix lint
googsvg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # SDK Maintenance Instructions | ||
|
|
||
| ## Your Role | ||
| You are an expert at Kotlin and Java and maintain the Nylas Kotlin/Java SDK which is an interface for Nylas' APIs. | ||
|
|
||
| Your job is to maintain parity with the API to ensure that the SDK supports all that the API supports. | ||
|
|
||
| ## Task Workflow | ||
|
|
||
| When asked to add support for a new feature, query parameter, or API endpoint, follow this workflow: | ||
|
|
||
| ### 1. Understand the Codebase | ||
| - Scan the project structure | ||
| - Understand the architecture and how it's organized | ||
| - Identify existing patterns and conventions | ||
| - Review similar existing implementations | ||
|
|
||
| ### 2. Write Tests First (TDD) | ||
| - Implement tests for the new feature BEFORE writing implementation code | ||
| - Ensure backward compatibility is maintained | ||
| - **Never modify existing tests unless absolutely necessary** | ||
| - **IF BACKWARDS COMPATIBILITY CANNOT BE ACHIEVED, STOP AND INFORM THE USER** | ||
|
|
||
| ### 3. Implement the Solution | ||
| - Follow existing code patterns and conventions | ||
| - Maintain consistency with the rest of the codebase | ||
| - Keep changes minimal and focused | ||
| - Only modify production code in `src/main/` | ||
| - Only modify test code in `src/test/` | ||
|
|
||
| ### 4. Update the CHANGELOG | ||
| - Update `CHANGELOG.md` following conventional commits format | ||
| - Always add changes under an "Unreleased" version section | ||
| - Keep updates concise - one line per change | ||
| - Never include code examples in the changelog | ||
| - Format: `* Brief description of the change` | ||
|
|
||
| ### 5. Create Examples (if applicable) | ||
| - If the feature is user-facing, create an example in `examples/` | ||
| - Follow the pattern of existing examples | ||
| - Provide both Java and Kotlin examples when relevant | ||
|
|
||
| ### 6. Run Linters and Fix Formatting | ||
| - Run: `./gradlew formatKotlin` | ||
| - Run: `./gradlew lintKotlin` | ||
| - Fix any formatting or linting errors | ||
|
|
||
| ### 7. Verify Tests Pass | ||
| - Run: `./gradlew test` | ||
| - Ensure all tests pass before proceeding | ||
|
|
||
| ### 8. Git Commit | ||
| - Follow conventional commits format | ||
| - Format: `type(scope): description` | ||
| - Types: `feat`, `fix`, `docs`, `test`, `refactor`, `chore` | ||
| - Examples: | ||
| - `feat(folders): add include_hidden_folders query parameter` | ||
| - `fix(messages): correct attachment encoding for files < 3MB` | ||
| - `test(calendars): add coverage for event recurrence` | ||
|
|
||
| ## Important Notes | ||
|
|
||
| - **Production Code Safety**: The SDK is live in production. Never break existing functionality. | ||
| - **Test Coverage**: Aim to maintain or improve test coverage. Current target is 99% by Q3. | ||
| - **Backward Compatibility**: This is critical. If you can't maintain it, stop and inform the user. | ||
| - **Java Version**: Project uses Java 11 (toolchain set to Java 8 for compatibility) | ||
| - **JAVA_HOME**: `/Users/gordan.o@nylas.com/Library/Java/JavaVirtualMachines/temurin-11.0.29/Contents/Home` | ||
|
|
||
| ## Code Patterns | ||
|
|
||
| ### Query Parameters | ||
| Query parameters are defined in `src/main/kotlin/com/nylas/models/*QueryParams.kt` files using: | ||
| - Data classes with nullable properties | ||
| - Builder pattern for construction | ||
| - `@Json(name = "...")` annotations for JSON serialization | ||
|
|
||
| ### Resource Methods | ||
| Resource classes in `src/main/kotlin/com/nylas/resources/*.kt` follow this pattern: | ||
| - Inherit from `Resource(client)` | ||
| - Use HTTP methods: `list()`, `find()`, `create()`, `update()`, `destroy()` | ||
| - Accept query params as optional parameters | ||
| - Return typed responses: `Response<T>`, `ListResponse<T>`, `DeleteResponse` | ||
|
|
||
| ### Tests | ||
| Test files in `src/test/kotlin/com/nylas/resources/*Tests.kt` use: | ||
| - Mockito for HTTP mocking | ||
| - JUnit 5 for test framework | ||
| - Nested test classes for organization | ||
| - Pattern: mock HTTP client → execute method → verify request → assert response | ||
|
|
||
| ## Quality Checklist | ||
|
|
||
| Before considering a task complete: | ||
| - [ ] Tests written and passing | ||
| - [ ] Implementation follows existing patterns | ||
| - [ ] CHANGELOG.md updated | ||
| - [ ] Examples created (if applicable) | ||
| - [ ] Linters pass | ||
| - [ ] All tests pass | ||
| - [ ] Backward compatibility maintained | ||
| - [ ] Git commit created with conventional commit message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(export JAVA_HOME=/Users/gordan.o@nylas.com/Library/Java/JavaVirtualMachines/corretto-11.0.29/Contents/Home:*)", | ||
| "Bash(./gradlew test:*)", | ||
| "Bash(export JAVA_HOME:*)", | ||
| "Bash(./gradlew jacocoTestReport:*)", | ||
| "Bash(open build/reports/jacoco/test/html/index.html)", | ||
| "Bash(cat:*)", | ||
| "Bash(find:*)", | ||
| "Bash(./gradlew clean build:*)", | ||
| "Bash(java -version:*)", | ||
| "Bash(/usr/libexec/java_home:*)" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.