Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Forum tree manager and data synchronisation #324

Open
4 of 8 tasks
Kaik opened this issue Sep 10, 2017 · 3 comments
Open
4 of 8 tasks

Forum tree manager and data synchronisation #324

Kaik opened this issue Sep 10, 2017 · 3 comments

Comments

@Kaik
Copy link
Contributor

Kaik commented Sep 10, 2017

Forum tree management needs to be recreated.
Dizkus current "Recalculate..." function is not efficient. Recalculating big forum end with a timeout.
So I decided I will create dedicated admin page with jstree and tree walker so synchronization can be done in small steps. This page will be as well prototype for new full ajax admin forum tree management.

Todo:

  • Forum tree manager
  • sync create dedicated page
  • sync implement helper methods needed for jstree (tree walker)
  • sync recreate create synchronization procedure
  • sync strategies and settings
    • Normal default strategy increment decrement set last post on update
    • Partial - recount forum posts and topics basing on subforums and children topics data
    • Force to recount and save the real value.

There are three sync areas which are connected to each other. The base for everything is topic and its posts it is a source of information for two other areas users and forum tree.
Users area is kind of independent of the topic (topic does not need to be synced to sync users) because users and posts are connected directly. Forum sync relays on accurate topic data so last post and posts/reply count (postCount = replyCount + 1) and on accurate sub-forums data postCount topicCount last post.

Sync is called:

  • partial sync - during normal forum activities like add topic, add a post, edit, remove etc.. and moderate
  • admin "full" sync in administration

Normal sync - I think I will use events to handle this.
Add post example: User is adding post after it is done sync topic is called which is handling topic sync (reply count last post it) - I still do not know details of it, topic sync event might not be needed it might be done "internally" by topic (maybe doctrine events etc). User post/topic count need to be updated this might not need an event as well but we will see. Forums up to the top need to be updated with posts/topics counts and last post and here I think event which is calling itself for parent will/might be a proper solution.

Admin "full sync" page will be divided into 3 parts:

  • users sync where you can sync single user as well as all users, as explained above this is an independent area.
  • topic sync where we call sync on all topics - this step is needed for forum sync to be accurate.
  • forum sync - when topics are all synced and all data is correct we can sync forums as well from the bottom to the top.

Additionally I want to make it ajax and non ajax*(I might abandon non ajax sync at some point).
Most probably during the full sync forum will be disabled for maintenance - syncing big forums will take some time so it is needed to prevent any user-forum interactions during syncing.

Forum:

  • topic count
  • post count
  • last post

Topic:

  • reply count
  • last post

Post:
... no sync needed

User:

  • posts count
  • topics count (new feature)
@Kaik Kaik changed the title Dizkus data synchronisation Forum tree manager and data synchronisation Oct 6, 2017
@Kaik
Copy link
Contributor Author

Kaik commented Oct 6, 2017

So below is the current stage of "new" forum manager view - this is non ajax and ajax view. It is compatible with js tree and I'm working on both ajax/no-script-ajax versions. I will add more info there like post topic counts etc and much more...

Things can get corrupted (after import or just during site errors, crash etc...). There is Tree structure corruption and forum data "corruption" - last post - posts - topics etc.. For structure I will use doctrine to detect and then fix it while for forum data sync functionality is needed.

screencapture-core15-desktop-local-dizkus-forum-tree-1507359826399

screencapture-core15-desktop-local-dizkus-forum-tree-1507359921337

@Kaik
Copy link
Contributor Author

Kaik commented Oct 7, 2017

Additionally, all forum admin functions were moved to forum controller for consistency.

@Kaik
Copy link
Contributor Author

Kaik commented Nov 24, 2017

I was able to move sync related activities to one class and already implemented basic sync - incrementing, last post etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant