-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
Fix API instance create twice issue & Make PluginManager.API private #3297
Fix API instance create twice issue & Make PluginManager.API private #3297
Conversation
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. Forbidden patterns 🙅 (1)In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves. These forbidden patterns matched content: s.b. workaround(s)
If the flagged items are 🤯 false positivesIf items relate to a ...
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThis pull request refactors the API initialization mechanism and updates API references. The Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Calling Code
participant PM as PluginManager
participant Ioc as Ioc.Default
Caller->>PM: Access API property
PM->>PM: Check if 'api' is null
alt api is null
PM->>Ioc: GetRequiredService<IPublicAPI>()
Ioc-->>PM: Return IPublicAPI instance
PM-->>Caller: Return initialized API
else
PM-->>Caller: Return cached API
end
sequenceDiagram
participant UI as Application Component
participant App as App.API
participant Service as IPublicAPI
UI->>App: Invoke API method (e.g. OpenUrl, SaveAppAllSettings)
App->>Service: Perform API operation
Service-->>App: Return operation result
App-->>UI: Return response
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (9)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@taooceros I have targeted the source of this issue and now it works fine for me. |
looks cool! wonderful i will review it once i get to computer |
Ideally we should also make PluginManager as a Singleton, but let's keep it like this for now as that might take quite a few work. |
From #3296
We should not initialize API in static constructor or it will create another API instance.