Skip to content

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented Apr 29, 2025

Backport of PR #308

  • make it backport compatible with old flow register mechanism
  • then also trigger backport to 30

@backportbot backportbot bot requested a review from blizzz April 29, 2025 11:51
@backportbot backportbot bot added 3. to review Waiting for reviews technical debt labels Apr 29, 2025
@blizzz blizzz added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Apr 29, 2025
@blizzz blizzz force-pushed the backport/308/stable31 branch 2 times, most recently from 1ebc092 to 39fd040 Compare April 30, 2025 15:06
@blizzz

This comment was marked as resolved.

@blizzz blizzz force-pushed the backport/308/stable31 branch from 39fd040 to b5f8edd Compare May 7, 2025 12:38
@blizzz
Copy link
Member

blizzz commented May 7, 2025

/backport to stable30

@backportbot backportbot bot added the backport-request A backport was requested for this pull request label May 7, 2025
@blizzz blizzz requested a review from max-nextcloud May 7, 2025 12:39
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 7, 2025

let customElementId
// we may only compare first three numbers of the version
if (semver.gt(window.OC.config.version.split('.', 3).join('.'), '31.0.2')) {
Copy link
Member

Choose a reason for hiding this comment

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

Without this condition, I get this.$root.props is undefined on NC 31 <= 31.0.2 even though the component is not used 😒

otoh there is also no necessity to create it for nothing, so it is not bad to have the check there.

Choose a reason for hiding this comment

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

I briefly checked for related API changes that we could detect instead but found none.
Not sure which line throws the undefined error - we could also catch that. But this seems most explicit and clean anyway.

Copy link
Member

Choose a reason for hiding this comment

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

This only appears when the component is actually not used. Somewhere along the store's addRule call (i showed you the strace). My explanation for now is that there is some event (handler) or so being called and since this is not embedded properly anywhere it stumbles.

Copy link

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Just a bit of nitpicking about complex input handling. Other than that the code looks good.

Choose a reason for hiding this comment

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

To be frank I don't quite understand what's going on here. It seems overly complicated but I don't exactly know what you are trying to achieve. I will start from top to bottom and add a few comments to write down (and maybe improve) my understanding.

if (value === null) {
return
}
this.inscription = value.target.value

Choose a reason for hiding this comment

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

Yes... this should not be necessary as v-model should take care of it. Maybe the emitInput function is triggered before the v-model sync.
I'd suggest moving this to a watch on inscription then you can be sure the value was already updated. This would also save you the check for value === null (where I'm also unsure if it's needed).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, totally right. Interesting too see that vue let's you solve things in different ways. This one wasn't suggested to me before 😓 but I followed and replaced this event handler with the watcher.

@blizzz
Copy link
Member

blizzz commented May 9, 2025

Thank you for your input @max-nextcloud I'll try to reduce it further, checking against both 30.0.2 and stable31.

@blizzz blizzz added 2. developing Work in progress and removed 3. to review Waiting for reviews labels May 9, 2025
@blizzz blizzz force-pushed the backport/308/stable31 branch from b5f8edd to 28a5def Compare May 9, 2025 14:25
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 9, 2025
@blizzz blizzz merged commit 22fddeb into stable31 May 9, 2025
20 checks passed
@blizzz blizzz deleted the backport/308/stable31 branch May 9, 2025 14:28
@backportbot backportbot bot removed the backport-request A backport was requested for this pull request label May 9, 2025
@nextcloud nextcloud deleted a comment from backportbot bot May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants