Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Mobile
Minds Mobile
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Dependency List
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 122
    • Issues 122
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 15
    • Merge Requests 15
  • Packages
    • Packages
    • List
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Minds
  • Minds MobileMinds Mobile
  • Merge Requests
  • !86

Closed
Opened 4 months ago by Ben Hayward@benhayward.ben
  • Report abuse
Report abuse

[Sprint/Votes](bug): Hard coded a stop for duplicate blog entries being added based on length

minds#219 (closed)

Is the data held in response.entities here the full list of entries to be displayed regardless of which tab it is on? For example, if it only grabs 64 entries at a time, and then another call is made later for the next entries [65-128], this will not work.

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://gitlab.com/benhayward.ben/mobile-native.git duplicates-on-blogslist-mob
git checkout -b benhayward.ben/mobile-native-duplicates-on-blogslist-mob FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff benhayward.ben/mobile-native-duplicates-on-blogslist-mob

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge benhayward.ben:duplicates-on-blogslist-mob into master
  • Email patches
  • Plain diff
Pipeline #52418970 passed for 8c647730 on benhayward.ben:duplicates-on-blogslist-mob
    Requires 2 more approvals.

    Closed by Ben Hayward 7 minutes ago

    The changes were not merged into master

    Allows commits from members who can merge to the target branch

    Mentions minds#219 (closed)

    Deletes source branch

    • Discussion 5
    • Commits 1
    • Pipelines 1
    • Changes 1
    0/1 thread resolved
    • Loading...
    • Martin Santangelo
      Martin Santangelo @msantang78 started a thread on the diff 4 months ago
      Last updated by Martin Santangelo 4 months ago
      src/blogs/BlogsStore.js
      30 30 response.entities.shift();
      31 31 }
      32 32 response.entities = BlogModel.createMany(response.entities);
      33 if(response.entities.length === this.list.entities.slice(0).length) return;
      • Martin Santangelo
        Martin Santangelo @msantang78 · 4 months ago
        Maintainer

        I think that here the blog service needs to use the request abort. The flat list fires the OnEndReached event many times usually.

        For example: https://gitlab.com/minds/mobile-native/blob/master/src/groups/GroupsService.js#L21

      • Ben Hayward
        Ben Hayward @benhayward.ben · 4 months ago
        Developer

        Like so?

        That seems to have stopped any second call being made, but allows you to scroll down through white space.

        Edited by Ben Hayward 4 months ago
      • Martin Santangelo
        Martin Santangelo @msantang78 · 4 months ago
        Maintainer

        you have to send 'blogs:list' as the third parameter of the api.get() call: const data = await api.get(endpoint, { limit: 12, offset: offset }, 'blogs:list');

        This will 'tag' the fetch, and in the next call to abort('blogs:list') it will cancel the previous one (if it is not finished)

      • Please register or sign in to reply
    • Ben Hayward
      Ben Hayward @benhayward.ben · 4 months ago
      Developer

      Updated to match but now only the first batch load, and the FlatList is huge (or the visible container atleast). Is there anything you can think of that I could add into a conditional around the abort? Not quite sure of what I have a hold of in scope in the service.

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

      No longer occuring.

    • Ben Hayward @benhayward.ben closed 7 minutes ago

      closed

    • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
    Please register or sign in to reply
    0 Assignees
    None
    Assign to
    None
    Milestone
    None
    Assign milestone
    None
    Time tracking
    No estimate or time spent
    0
    Labels
    None
    Assign labels
    • View project labels
    Lock merge request
    Unlocked
    2
    2 participants
    user avatar
    Ben Hayward
    user avatar
    Martin Santangelo
    Reference: minds/mobile-native!86