Skip to content
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

[Bug] Impossible to override globale retention policy in a room with a bigger value. #20186

Closed
finkyseb opened this issue Jan 13, 2021 · 5 comments · Fixed by #32454
Closed

Comments

@finkyseb
Copy link

Description:

It seems impossible to specify a bigger room retention policy in the web interface.
The new value is written in the mongo database, but in the preferences of the room the the policy is set to the globale value.

Steps to reproduce:

  1. You must set a global retention policies ex: 30 days.
  2. Go on a channel and try to set a value bigger than the global one You can do the same with the APi or directly in BDD (it's the same result)
  3. The value is correctly written in the database
  4. You can check that the value is always the general value not yours.
  5. If you set a value lower than the global value it works and the new value is yours.

Expected behavior:

We expect that if a value is specified on a room, this value override the globale retention value and that in all cases.
We don't want the application takes only the smaller value.

Actual behavior:

Screenshots can be done, but I think the description is enough to reproduce the bug.

Server Setup Information:

  • Version of Rocket.Chat Server: 3.9.1 to 3.10.3
  • CENTOS (on docker):
  • Deployment Method: docker (swarm)
  • Number of Running Instances: 12
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 12.18.4
  • MongoDB Version: 4.2.11

Client Setup Information

  • Desktop App or Browser Version: insignificant
  • Operating System: insignificant
@leManu
Copy link

leManu commented Jan 13, 2021

Maybe the problem sits in that line ?

const { maxAge = 30, filesOnly, excludePinned, ignoreThreads } = room.retention;

maxAge is always 30...

@finkyseb
Copy link
Author

finkyseb commented Jan 13, 2021

I don't think so.
The value is set to 30 only if the value in room.retention is not set.
But it can't happened because we search only rooms with this attributes :

'retention.enabled': { $eq: true },
'retention.overrideGlobal': { $eq: true },
'retention.maxAge': { $gte: 0 },

@finkyseb
Copy link
Author

After more tests, it seems the room configuration is taken by the cron job correctly, but only the value in the webinterface in the room information is incorrect.
Anybody can confirm that ?

@EnCz
Copy link

EnCz commented Jan 13, 2021

After more tests, it seems the room configuration is taken by the cron job correctly, but only the value in the webinterface in the room information is incorrect.
Anybody can confirm that ?

Yes that seems to be the case. Retention Policy Settings are a little bit wonky at the moment.

In Administration we have activated the retention policy but didn't apply it to any room:
image

So our users can overwrite this setting on a per-room basis. Still every room has this message in it's room info:
image

even though there is no retention policy set for that specific room.

If you go ahead and set a per-room policy it seems to work as intended (even though the box will still display "30" even if you e.g. define 5).
Warning: Sometimes you need to save a per-room configuration twice.

We also have issues with threads. Those doesn't seem to get deleted by the retention policy even though we have this settings in administration:
image

So yes.. you can get it to work but retention policies seem to have a lot of little issues at the moment. I would be very happy if this gets resolved sometimes.

I also alredy opened two tickets right here:
#19730
#19731

Also someone on french posted here:
EsupPortail/esup-mod_rocketchat#21

@sampaiodiego maybe you can say something about this ?

@finkyseb
Copy link
Author

probably fix in #20349

@finkyseb finkyseb changed the title Impossible to override globale retention policy in a room with a bigger value. [Bug] Impossible to override globale retention policy in a room with a bigger value. Jan 25, 2021
@kodiakhq kodiakhq bot closed this as completed in #32454 May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants