tolgee-platform icon indicating copy to clipboard operation
tolgee-platform copied to clipboard

Activity label breaks, when tag added to 0 keys

Open stepan662 opened this issue 1 year ago • 7 comments

Snímek obrazovky 2024-07-23 v 17 35 45

stepan662 avatar Jul 23 '24 15:07 stepan662

Is this frontend or backend issue?

JanCizmar avatar Jul 25 '24 12:07 JanCizmar

I didn't investigate much further, I think there is some issue with the statistics returned from the backend, there is some value KeyCount, which is normally a number and in this case is missing. For other batch operations it seems to be there, but not for this one. Can be fixed on the FE, but would be nice if it would behave consistently.

stepan662 avatar Jul 25 '24 13:07 stepan662

I'll look into that 🙂

huglx avatar Aug 12 '24 12:08 huglx

@stepan662 can you please help me with reproducing this bug. Thanks:)

huglx avatar Aug 12 '24 15:08 huglx

It happens when the batch operation adds 0 tags (can happen if the keys are already tagged with the same tag)

https://github.com/user-attachments/assets/8dcacc57-78c6-43e5-8a0f-f67952d6b028

stepan662 avatar Aug 13 '24 07:08 stepan662

@JanCizmar, @stepan662 Is it okay if I just throw an exception when adding a tag to 0 keys? Or is this a useful feature (idk why)?

huglx avatar Aug 13 '24 11:08 huglx

No, we shouldn't throw any errors, it's a valid case that can happen. We might skip activity creation all together (as basically nothing changed). But maybe we should tell the user how many keys were actually updated - however if this is complicated, I think it's enough to just not to create activity.

stepan662 avatar Aug 13 '24 11:08 stepan662