Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Frontend
Minds Frontend
  • Project overview
  • Repository
  • Issues 346
  • Merge Requests 57
  • CI / CD
  • Security & Compliance
  • Packages
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds FrontendMinds Frontend
  • Merge Requests
  • !717

Open
Opened 1 hour ago by Ben Hayward@benhayward.ben
Report abuse

Stopping posts being made while rich-embed preview processing #2418

  • Overview 2
  • Commits 2
  • Pipelines 2
  • Changes 3
0/1 thread resolved

Summary

Closes #2418

Original change on prod is that if you hit enter too quickly after posting a link, it will not post with the rich embed preview. That will upload in a separate comment below after the comment is posted.

Steps to test

  1. Log in and go to a post
  2. Copy a link e.g. https://www.google.com/
  3. Paste it into a comment on the post and repeatedly and rapidly hit enter until the preview is done
  4. it should post with the preview, waiting till the preview is ready.
  5. Repeat with an invalid URL e.g. https://www.ks3fnj3n9.com
  6. it should only post when it's been processed for an available preview - you should see the loading indicator that indicates when this is happening.

Estimated Regression Scope

This feature touches a few areas

  1. It affects when a user can post by directly stopping the user from posting until progress equal to 100, when a rich-embed is detected. In the worst-case, this could conceivably stop users posting in some edge-case situation.

  2. It uses the same progress mechanism as image uploads - I felt it made the most sense as there shouldn't be an overlap of uploading an image and a rich-embed. Regardless, tests one after the other are good.

Request to merge fix/premature-rich-embed-posting-2418 into master
The source branch is 8 commits behind the target branch
Open in Web IDE
Pipeline #108244421 passed with warnings for 73a55104 on fix/premature-rich-embed-posting-2418
              Requires approval from Deployers. Approved by
              Xander Miller
              Xander Miller
              Rami Albatal
              Rami Albatal
              Guy Thouret
              Guy Thouret
              Marcelo Rivera
              Marcelo Rivera
              Emiliano Balbuena
              Emiliano Balbuena
              Brian Hatchet
              Brian Hatchet
              Ready to be merged automatically. Ask someone with write access to this repository to merge this request

              Closes #2418

              Deletes source branch

              • Ben Hayward @benhayward.ben added Squad::Yellow Status::Awaiting Review scoped labels 1 hour ago

                added scoped labels

              • Ben Hayward @benhayward.ben added 1 commit 1 hour ago

                added 1 commit

                • 73a55104 - Making getPostPreview async again

                Compare with previous version

              • Ben Hayward
                Ben Hayward @benhayward.ben started a thread on the diff 1 hour ago
                src/app/modules/comments/poster/poster.component.ts
                174 174 this.detectChanges();
                175 175 }
                176 176
                177 async getPostPreview(message) {
                178 if (!message) {
                177 /**
                178 * Checks for rich-embed and fetches a preview.
                179 *
                180 * @param { string } - message to be parsed.
                181 */
                182 async getPostPreview(message: string) {
                183 if (
                184 !message ||
                185 this.attachment.getMeta().is_rich ||
                186 !this.attachment.containsRichEmbed(message)
                • Ben Hayward
                  Ben Hayward @benhayward.ben · 1 hour ago
                  Developer

                  This call is also made inside of the attachment.preview() function, so gets called twice. I split it off into its own function because:

                  1. I need to be able to call it outside the scope of the attachment service.
                  2. I wanted to be as delicate as possible with my changes to the attachment service.
                  Edited by Ben Hayward 1 hour ago
                • Please register or sign in to reply
              • Xander Miller @xander-miller approved this merge request 8 minutes ago

                approved this merge request

              • Xander Miller
                Xander Miller @xander-miller · 3 minutes ago
                Developer

                Seems to wait to post after load whether it's a valid or invalid link. I don't see the difference in behavior though. Thumbnails are loading on sandbox, but I can see the delay when compared to production.

              Please register or sign in to reply
              0 Assignees
              None
              None
              Milestone
              None
              Time tracking
              No estimate or time spent
              2
              Labels
              Squad::Yellow Status::Awaiting Review
              Lock merge request
              Unlocked
              11
              11 participants
              user avatar
              Rami Albatal
              user avatar
              Guy Thouret
              user avatar
              Marcelo Rivera
              user avatar
              Emiliano Balbuena
              user avatar
              Brian Hatchet
              user avatar
              Mark Harding
              user avatar
              Juan Manuel Solaro
              Reference: minds/front!717

              Now you can access the merge request navigation tabs at the top, where they’re easier to find.

              More information and share feedback