Skip to content

Commit

Permalink
fix: forget queuedEventGroup when emitting response in responseReceiv…
Browse files Browse the repository at this point in the history
…edExtraInfo
  • Loading branch information
YusukeIwaki committed May 9, 2022
1 parent 5dc0d46 commit d9090ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/puppeteer/network_event_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,8 @@ def enqueue_event_group(network_request_id, queued_event_group)
def get_queued_event_group(network_request_id)
@queued_event_group_map[network_request_id]
end

def forget_queued_event_group(network_request_id)
@queued_event_group_map.delete(network_request_id)
end
end
1 change: 1 addition & 0 deletions lib/puppeteer/network_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def request_interception=(enabled)
# We may have skipped response and loading events because we didn't have
# this ExtraInfo event yet. If so, emit those events now.
if_present(@network_event_manager.get_queued_event_group(event['requestId'])) do |queued_events|
@network_event_manager.forget_queued_event_group(event['requestId'])
emit_response_event(queued_events.response_received_event, event)
if_present(queued_events.loading_finished_event) do |loading_finished_event|
emit_loading_finished(loading_finished_event)
Expand Down

0 comments on commit d9090ec

Please sign in to comment.