[MGNLUI-3936] Newly created messages are not be stored in proper date folder Created: 05/Jul/16 Updated: 18/Aug/21 |
|
| Status: | Accepted |
| Project: | Magnolia UI |
| Component/s: | messages app |
| Affects Version/s: | 6.2.11 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Richard Gange | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | maintenance, support | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Template: |
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||
| Description |
|
Currently messages are organized in the messages workspace by username. So each username has an entry in the workspace. Under the username node there can be several message nodes all organized at the same level (see messages.png attached). This creates a performance problem when a user accumulates too many messages under a single username node. This issue is similar to one we had with tasks (see Workaround import info.magnolia.context.MgnlContext; import javax.jcr.Session; import javax.jcr.Node; import javax.jcr.NodeIterator; def removeMessages(username) { try { Session session = MgnlContext.getJCRSession("messages"); path = "/" + username; Node usertree = session.getNode(path); NodeIterator childrenIterator = usertree.getNodes(); while (childrenIterator.hasNext()) { Node node = childrenIterator.nextNode(); path = node.getPath(); println "about to remove ${path} item"; session.removeItem(path); } session.save(); println "messages of ${username} removed"; } catch (Exception e) { println e; } } //example of usage removeMessages("superuser"); |