Skip to content

Register services early in case they might already be queried though other registrations - #22727

Closed
juliusknorr wants to merge 1 commit into
masterfrom
bugfix/noid/service-registration-early
Closed

Register services early in case they might already be queried though other registrations#22727
juliusknorr wants to merge 1 commit into
masterfrom
bugfix/noid/service-registration-early

Conversation

@juliusknorr

Copy link
Copy Markdown
Member

Otherwise services might not be resolved since they are registered too late

…the other registations
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorrjuliusknorr added bug 3. to review Waiting for reviews labels Sep 8, 2020
@juliusknorrjuliusknorr added this to the Nextcloud 20 milestone Sep 8, 2020
@ChristophWurst

Copy link
Copy Markdown
Member

🤔 where is that a problem? Shouldn't the registration part be as lazy as possible? Like in a sense that nothing really is executed yet.

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

thinking where is that a problem? Shouldn't the registration part be as lazy as possible? Like in a sense that nothing really is executed yet.

Ideally yes, just found this when debugging nextcloud/deck#2275 and thought it might be a good hardening to avoid possible issues in case app developers don't properly handle lazy registration like myself ;)

@ChristophWurst

Copy link
Copy Markdown
Member

At this very early stage of the process lifetime, no other apps nor all of the server components are ready. Therefore the app must not try to use anything except the API provided by the context.

https://docs.nextcloud.com/server/latest/developer_manual/app_development/bootstrap.html#nextcloud-20-and-later

🙈 so I would not see this as a hardening step. The premise of of the register and boot separation is to not have any assumptions about what's there in the early call of register.

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👎 as of #22727 (comment) :)

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

Ok, let's close then 👍

@juliusknorr
juliusknorr deleted the bugfix/noid/service-registration-early branch September 8, 2020 12:26
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@juliusknorr@ChristophWurst@rullzer