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

Forum tech debt + cleanup #766

Closed
bedeho opened this issue Jun 23, 2020 · 2 comments
Closed

Forum tech debt + cleanup #766

bedeho opened this issue Jun 23, 2020 · 2 comments

Comments

@bedeho
Copy link
Member

bedeho commented Jun 23, 2020

Debt

  • Remove internal actor representations: Remove internal actor representations #762
  • Remove commented out add_extra_genesis fragment.
  • CategoryByModerator models a set, as such it should just map to an empty type, as the bool value type has no semantic meaning, and can be misleading.
  • Remove all label label semantics in the runtime.
  • Drop the concept of ChildPositionInParentCategory which is used for Category.position_in_parent_category, just use an optional identifier to a parent.

Removing archival state

Before we had proper query infrastructure (now being built), all the business logic state powering the UIs had to come directly from the blockchain state. This meant we shoved lots of write only data in there for archival purposes, this should be avoided. Here we will attempt to remove all such data.

  • We no longer store category names, post/thread titles or texts, or any other text, just the hash.
  • We no longer enforce length constraints on any such texts either, hence all such parameters and checks can be removed.
  • We no longer store old versions of an edited post.
  • We no longer store poll alternative texts: PollAlternative.alternative_text, just hash.
  • We no longer store write only dates (e.g. encoded by BlockchainTimestamp), such as when something was created (e.g. Poll.start_time).
  • We no longer store Post.nr_in_thread and Thread.nr_in_category.
  • We no longer store num_unmoderated_posts and num_moderated_posts in Thread.
  • Drop all deletion indicators (post, threads, categories), see next section for genuine deletion.
  • We no longer store title, description, creation date, deletions status in categories. They should however just have a single counter for the number of threads and the number of subcategories in as these are not archival, since they must be read when evaluating whether category deletion is safe. But there is no need to distinguish between number of moderated vs. unmoderated threads.

Enhancements

  • Make thread title editable by author.
  • Allow moderators to move threads between categories, if they have power in both source and destination.
  • Make maximum category depth parameter getable through runtime trait parameters, remove from storage: MaxCategoryDepth
  • Efficient thread deletion: Efficient thread deletion #760
  • Moderation semantics for posts changed to mean that it is deleted by the moderator, and that some accompanying rationale is submitted, but is not itself stored.
  • Moderation semantics for threads changed in the same way as posts. This can only be done after efficient thread deletion has been implemented.
  • Forum category deletion: Forum category deletion #761
  • Allow both the author and forum moderators to update archival status.
  • Generalize PostReaction: Generalize PostReaction #763
  • Use new type safe error mechanism.
  • Address this Substrate coding conventions II #374 (comment)
  • There are one or more cases where ensures should be introduced, in line with this Substrate coding conventions I #404 (comment), for example for categories. Identify all such cases.
  • Drop set_max_category_depth and the value in storage, its not safe. Instead make it a parameter in the runtime trait.
  • Rename set_moderator_category to update_category_membership_of_moderator
  • I am now seeing a call to clear_prefix, but I cannto recall why this happens every time, I think it has something to do with migration, but not sure hwy it keeps running. Please investiagate and check whether it is appropriate.
@ondratra
Copy link
Contributor

ondratra commented Jul 15, 2020

Additional issues:

@bedeho
Copy link
Member Author

bedeho commented Sep 16, 2020

Done

@bedeho bedeho closed this as completed Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants