yuuvis® RAD Q&A

0 votes
by (260 points)

Hello yuuvis-team,

I am trying to delete an item out of the users`s favorites while being subscribed to userService.favorites$ and userService.getFavorites().

userService.removeFavorite() succeeds returning "null", then the subscriptions deliver a new array of favorites - but one still containing the removed favorite!

Adding a new favorite using userService.createFavorite() does not show this phenomenon - after success, the subscriptions return a new array of favorites containing the newly created one.

This is really annoying:
The user still sees the (removed) favorite. Trying to remove it again results in an error (404 not found - sounds reasonable though, it was removed!)

Is this a bug in @eo-sdk/core (6.12.0), in yuuvis (6.16.2) or am I doing something wrong?

Thanks,
Stefan

2 Answers

0 votes
by (260 points)

Updateing @eo-sdk/core to 6.16.2 doesn`t help, btw. Seems logic, I guess the issue is in the backend.

Any clue about this anybody?

by (14.7k points)
Hi Stefan,

this seems to be a bug. I have created this internal Ticket for our analyses: DB-5366

But it could be good to report this bug to support@optimal-systems.de so that the bugfix-process will go well.

We will probably deliver the bugfix with the next hotfix.

Kind Regards
Martin
by (260 points)
Hello Martin,

thanks. I sent the bug once more, as requested.

Kind Regards,
Stefan
0 votes
by (14.7k points)

Hi Stefan,

sorry for taking some more time for analyses! It's not really bug, if you do not to call the backend via rest, but use the client's userService instead.

Peter wrote this:

"Hi, please look at our example of Favorite Action in Client

Main difference is that we use userService... that way our components subscribe to all changes on this.userService.favorites$

constructor( private userService: UserService) {

}
run(selection: DmsObject[]) { selection.forEach(item => { const

{id, typeName, title}
= item; if (!item.isFavorite) { this.userService .createFavorite(id, typeName, title || id) .subscribe(() =>

{ this.eventService.trigger(EnaioEvent.DMS_OBJECT_FAVORITE_ON, id) }
, Utils.throw(null, this.translate.instant('eo.state.settings.presence.error.title'), this.translate.instant('eo.state.settings.presence.error.description') )); // todo: add proper error messages here } else { this.userService .removeFavoritesForTarget(id) .subscribe(() =>

{ this.eventService.trigger(EnaioEvent.DMS_OBJECT_FAVORITE_OFF, id) }
, Utils.throw(null, this.translate.instant('eo.state.settings.presence.error.title'), this.translate.instant('eo.state.settings.presence.error.description') )); // todo: add proper error messages here } }); } "

If you do need some more explanations we may take an appointment then.

Kind Regards,
Martin

Related questions

+2 votes
1 answer
asked Jun 3, 2020 by the_s (260 points)
+1 vote
1 answer
0 votes
2 answers
0 votes
2 answers
...