-
-
Notifications
You must be signed in to change notification settings - Fork 199
Fix infinite loop when consecutive releases return 304 Not Modified responses #344
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
|
@nobodyiam 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
|
感谢您提出Pull Request,我会尽快Review。我会在1-2日内进行查看或者回复,如果遇到节假日可能会处理较慢,敬请谅解。 |
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
|
The comment for |
…ithNamespace Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
You're absolutely right! I've refactored the implementation to truly wrap the existing |
|
There are quite a few changes to |
…r 304 detection Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
You're absolutely right! I've significantly reduced the scope of modifications by using a much simpler flag-based approach instead of the complex wrapper system. The new implementation:
This eliminates ~67 lines of complex wrapper code while achieving the same result. The approach leverages the existing |
|
An easier approach is to let |
…ning backward compatibility Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
You're absolutely right! I've implemented a much cleaner approach inspired by your suggestion. Instead of modifying the core The new implementation:
This approach is much more elegant than the previous complex wrapper system and addresses your concern about reducing the scope of modifications. See commit bfcd847. |
|
What I suggest is to change |
- Changed SyncWithNamespace signature to return (*config.ApolloConfig, error) - Updated all call sites to handle the new signature - Removed lastCallWasNotModified flag approach in favor of standard Go error handling - In async.go, use `apolloConfig != nil || err == nil` to detect successful responses including 304 - All tests pass, including the critical TestApolloConfig_SyncWith304NotModified test This is a much cleaner approach that eliminates the flag-based mechanism while maintaining backward compatibility and achieving the same result. Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
You're absolutely right! I've implemented your suggested approach, which is much cleaner than my flag-based solution. The changes:
This eliminates the All tests pass, including the critical |
nobodyiam
left a 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.
@copilot Please find some more comments below.
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
…ure commits Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
You're absolutely right! These JSON files were test artifacts accidentally committed to the repository. I've removed all of them and added .gitignore patterns to prevent future test artifacts from being committed. The patterns now cover:
All tests still pass and the artifacts are now properly ignored. See commit 5502dda. |
nobodyiam
left a 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.
@copilot revert the changes to the CallBack as commented below.
component/remote/async.go
Outdated
| func (a *asyncApolloConfig) CallBack(namespace string) http.CallBack { | ||
| return http.CallBack{ | ||
| SuccessCallBack: createApolloConfigWithJSON, | ||
| SuccessCallBack: createApolloConfigWithJSON, |
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.
| SuccessCallBack: createApolloConfigWithJSON, | |
| SuccessCallBack: createApolloConfigWithJSON, |
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.
Fixed field alignment to match original formatting with proper spacing. See commit e94b49a.
nobodyiam
left a 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.
@copilot revert the changes to the CallBack as commented below.
Co-authored-by: nobodyiam <837658+nobodyiam@users.noreply.github.com>
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Pull Request Test Coverage Report for Build 17515436925Details
💛 - Coveralls |
|
@nobodyiam 请问什么时候可以修复? 另外请问下 这个客户端对apollo功能支持度如何, 稳定性如何? |
nobodyiam
left a 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.
LGTM

SyncWithNamespacesignature to return(*config.ApolloConfig, error)err == nilinstead ofapolloConfig != nil || err == nilFixes #343.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.