Skip to content

Hyper model's while_loading does not work when loading scopes #67

Closed

Description

@catmando
# add this to the while_loading spec, and watch it fail!
...
   FactoryBot.create(:user, first_name: 'Lily', last_name: 'DaDog')
   FactoryBot.create(:user, first_name: 'Coffee', last_name: 'Boxer')
...
it "while loading works with relationships" do
   ReactiveRecord::Operations::Fetch.semaphore.synchronize do
     mount "WhileLoadingTester", {}, no_wait: true do
       class MyComponent < HyperComponent
         render do
           SPAN { 'loading...' }
         end
       end
       class WhileLoadingTester < HyperComponent
         render do
           UL do
             User.each { |user| LI { user.last_name } }
           end
           .while_loading 'loading...'
         end
       end
     end
     expect(page).to have_content('loading...')
     expect(page).not_to have_content('DaDog', wait: 0)
   end
   expect(page).to have_content('DaDog')
   expect(page).not_to have_content('loading...', wait: 0)
 end

last line of spec fails...

Activity

  1. catmando commented on Nov 19, 2018

    @catmando
    ContributorAuthor

    problem is that the WhileLoading assumes the number of loaded children stays constant. In this case it does not!

  2. changed the title [-]Hyper model's `while_loading` does not work when loading scopes[/-] [+]Hyper model's `while_loading` does not work with loading scopes[/+] on Nov 20, 2018
  3. changed the title [-]Hyper model's `while_loading` does not work with loading scopes[/-] [+]Hyper model's `while_loading` does not work when loading scopes[/+] on Nov 20, 2018
  4. added this to the alpha1.3 milestone on Dec 7, 2018
  5. catmando commented on Jan 15, 2019

    @catmando
    ContributorAuthor

    closed as part of changing while loading to use error boundries (it also fixed in the deprecated while_loading code, but who cares)

  6. added
    ready-to-releaseInternal Use Only: Has been fixed, specs passing and pushed to edge branch
    on Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-to-releaseInternal Use Only: Has been fixed, specs passing and pushed to edge branch

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions