Skip to content

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

Open
Opened 2 weeks ago by Ben Hayward@benhayward.ben
Report abuse

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

  • Overview 19
  • Commits 7
  • Pipelines 7
  • Changes 3
4/7 threads 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 57 commits behind the target branch
Open in Web IDE
Pipeline #111401081 passed with warnings for 582c9e4d on fix/premature-rich-embed-posting-2418
              Requires 3 more approvals from Devs, Deployers, and QA.
              Martin Santangelo Brian Hatchet Emiliano Balbuena Rami Albatal Xander Miller
              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 2 weeks ago

                added scoped labels

              • Ben Hayward @benhayward.ben added 1 commit 2 weeks 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 2 weeks ago
                Resolved by Brian Hatchet 2 weeks ago
              • Xander Miller @xander-miller approved this merge request 2 weeks ago

                approved this merge request

              • Xander Miller
                Xander Miller @xander-miller · 2 weeks 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.

              • Brian Hatchet :speech_balloon: @brianhatchet resolved all threads 2 weeks ago

                resolved all threads

              • Ben Hayward
                Ben Hayward @benhayward.ben · 2 weeks ago
                Developer

                The difference in behavior is that on production, if you type in hello here is a link https://www.google.com and hit enter instantly, the comment text will post, but the preview will appear on a new comment below when it's done.

                Unfortunately on sandbox there is still no API key for iframely . Moving to blocked.

                https://fix-admin-firehose-1658.minds.io/api/v1/newsfeed/preview?url=https%3A%2F%2Fwww.google.com {"status":403,"error":"Valid api_key is required to access API","meta":{"description":""}}

              • Ben Hayward @benhayward.ben added Status::Requires Changes scoped label and automatically removed Status::Awaiting Review label 2 weeks ago

                added scoped label and automatically removed label

              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 2 weeks ago
                Resolved by Ben Hayward 1 week ago
              • Ben Hayward @benhayward.ben added 1 commit 1 week ago

                added 1 commit

                • d6b5ce8b - Update for feedback

                Compare with previous version

              • Ben Hayward @benhayward.ben resolved all threads 1 week ago

                resolved all threads

              • Ben Hayward
                Ben Hayward @benhayward.ben · 1 week ago
                Developer

                Note there's a lot of null errors being thrown on pro pages on sandboxes. I've had a look but can't find any information to help find the source, and as it's cross sandbox, it's not caused by this MR.

              • Ben Hayward @benhayward.ben assigned to @edgebal 1 week ago

                assigned to @edgebal

              • Emiliano Balbuena @edgebal approved this merge request 1 week ago

                approved this merge request

              • Emiliano Balbuena
                Emiliano Balbuena @edgebal · 1 week ago
                Developer

                Looking good!

              • Emiliano Balbuena @edgebal added Status::Review scoped label and automatically removed Status::Requires Changes label 1 week ago

                added scoped label and automatically removed label

              • Emiliano Balbuena @edgebal assigned to @benhayward.ben and unassigned @edgebal 1 week ago

                assigned to @benhayward.ben and unassigned @edgebal

              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 1 week ago
                Resolved by Ben Hayward 5 days ago
              • Mark Harding @markeharding added Status::Requires Changes scoped label and automatically removed Status::Review label 1 week ago

                added scoped label and automatically removed label

                • Brian Hatchet
                  Brian Hatchet :speech_balloon: @brianhatchet · 6 days ago
                  Developer

                  This change seems to introduce breaking behavior for invalid links. On production, when I specify https://www.ks3fnj3n9.com - a spinner loads and then disappears, which seems like proper behavior.

                  On the review site, the spinner loads but it is then replaced by a big, broken image.

                • Collapse replies
                • Ben Hayward
                  Ben Hayward @benhayward.ben · 5 days ago
                  Developer

                  I don't see this behavior with these recent changes. Can you confirm?

                • Brian Hatchet
                  Brian Hatchet :speech_balloon: @brianhatchet · 5 days ago
                  Developer

                  :looking:

                • Please register or sign in to reply
              • Ben Hayward @benhayward.ben added 1 commit 5 days ago

                added 1 commit

                • d2c3462a - upgrade for feedback

                Compare with previous version

              • Brian Hatchet
                Brian Hatchet :speech_balloon: @brianhatchet started a thread on an old version of the diff 5 days ago
                Resolved by Brian Hatchet 5 days ago
              • Ben Hayward @benhayward.ben added 1 commit 5 days ago

                added 1 commit

                • f02ea2ea - getting rid of progress bar on invalid link

                Compare with previous version

              • Ben Hayward @benhayward.ben added 1 commit 5 days ago

                added 1 commit

                • 80dba002 - Fixed to make better use of RXJS

                Compare with previous version

              • Ben Hayward @benhayward.ben added 1 commit 5 days ago

                added 1 commit

                • 582c9e4d - Fixing error with invalid links

                Compare with previous version

              • Ben Hayward @benhayward.ben added Status::Awaiting Review scoped label and automatically removed Status::Requires Changes label 5 days ago

                added scoped label and automatically removed label

              • Emiliano Balbuena @edgebal added Status::Requires Changes scoped label and automatically removed Status::Awaiting Review label 4 days ago

                added scoped label and automatically removed label

              • Ben Hayward @benhayward.ben added Status::BuddyReview scoped label and automatically removed Status::Requires Changes label 3 days ago

                added scoped label and automatically removed label

              • Ben Hayward
                Ben Hayward @benhayward.ben · 3 days ago
                Developer

                Sorry about that, it needed the iframely key

              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 3 days ago
                src/app/modules/comments/poster/poster.component.ts
                59 63 this.minds = window.Minds;
                60 64 }
                61 65
                66 ngOnDestroy() {
                67 this.attachmentSubscription.unsubscribe();
                • Mark Harding
                  Mark Harding @markeharding · 3 days ago
                  Owner

                  potential unsubscribe from non initialised subscription

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 3 days ago
                src/app/modules/comments/poster/poster.component.ts
                189 */
                190 async getPostPreview(message: string) {
                191 if (
                192 !message ||
                193 this.attachment.getMeta().is_rich ||
                194 !this.attachment.containsRichEmbed(message)
                195 ) {
                179 196 return;
                180 197 }
                181 198
                182 this.attachment.preview(message, this.detectChanges.bind(this));
                199 this.canPost = false;
                200
                201 try {
                202 this.attachment.preview(message, this.detectChanges.bind(this)); // generate preview.
                203 this.attachmentSubscription = this.attachment.attachmentProgress$
                • Mark Harding
                  Mark Harding @markeharding · 3 days ago
                  Owner

                  Why are we making a subscription inside this function? What if a subscription already exists. I feel like I've commented this a few times already. Please research how Observables work.

                • Please register or sign in to reply
              • Mark Harding @markeharding added Status::Requires Changes scoped label and automatically removed Status::BuddyReview label 3 days ago

                added scoped label and automatically removed label

              • Ben Hayward
                Ben Hayward @benhayward.ben · 51 minutes ago
                Developer

                I think the fix we're attempting is incorrect too. If someone wants to just hit enter before a preview they should. The fix should be to not show rich embed when there is message there

              Please register or sign in to reply
              Assignee
              Ben Hayward's avatar
              Ben Hayward @benhayward.ben
              None
              Milestone
              None
              Time tracking
              No estimate or time spent
              2
              Labels
              Squad::Yellow Status::Requires Changes
              Lock merge request
              Unlocked
              11
              11 participants
              user avatar
              user avatar
              user avatar
              user avatar
              user avatar
              user avatar
              user avatar
              Reference: minds/front!717