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

Simplify authors fields in posts table, introduce better DB interaction for Posts #3027

Merged
merged 8 commits into from
Dec 21, 2023

Conversation

danyx23
Copy link
Contributor

@danyx23 danyx23 commented Dec 15, 2023

This PR does two things:

  • it changes the authors field in the posts table to contain simply an ordered list of authors (instead of an unordered list of json objects with {author: string, order: number} type)
  • it splits the PostRow type that represents a result for of the posts table into two, one PostRowRaw where authors and formattingOptions are still string fields and one PostRowEnriched where the json fields are parsed and the typed accordingly.

Comment on lines 4 to 6
const formattingOptionsMatch = html.match(
/<!--\s*formatting-options\s+(.*)\s*-->/
)

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on [library input](2) may run slow on strings starting with '<!--formatting-options ' and with many repetitions of ' '.
@danyx23 danyx23 changed the base branch from master to wp-sync-align-with-post-update-hook December 15, 2023 19:45
@danyx23 danyx23 force-pushed the wp-sync-align-with-post-update-hook branch from 9d5fbf7 to 33da95c Compare December 15, 2023 19:54
@danyx23 danyx23 force-pushed the simplify-post-authors-cleanup-post-type branch from 3717429 to 99a1840 Compare December 15, 2023 19:54
@danyx23 danyx23 force-pushed the wp-sync-align-with-post-update-hook branch from 33da95c to 9b6a951 Compare December 15, 2023 21:42
@danyx23 danyx23 force-pushed the simplify-post-authors-cleanup-post-type branch from 99a1840 to 91944d7 Compare December 15, 2023 21:42
@danyx23 danyx23 force-pushed the wp-sync-align-with-post-update-hook branch from 9b6a951 to 96fe052 Compare December 21, 2023 10:24
@danyx23 danyx23 force-pushed the simplify-post-authors-cleanup-post-type branch from 54e62fd to b1f8ed0 Compare December 21, 2023 10:24
Copy link
Contributor Author

danyx23 commented Dec 21, 2023

Merge activity

  • Dec 21, 12:23 PM: @@danyx23 started a stack merge that includes this pull request via Graphite.
  • Dec 21, 12:24 PM: @@danyx23 merged this pull request with Graphite.

Base automatically changed from wp-sync-align-with-post-update-hook to master December 21, 2023 17:24
@danyx23 danyx23 merged commit 33eb52e into master Dec 21, 2023
11 checks passed
@danyx23 danyx23 deleted the simplify-post-authors-cleanup-post-type branch December 21, 2023 17:24
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 this pull request may close these issues.

1 participant