Skip to content

Commit

Permalink
Merge branch 'main' into remove_broken_cookie_consent
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh authored Dec 10, 2024
2 parents 47a3d7a + 7a4fd73 commit 1e3114e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 33 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ Rails 8 RC2 is out. We're being eager early adopters with some big changes!
* Nicer import book page. Gave it some UX love.
* We use the built into Rails health check end point at `/healthcheck`. Please check your setup.
* Plus the usual list of updates to all our dependencies.
* If you don't have `P@10` defined, the migrations blow up. Thanks @frutik for find the bug. https://github.com/o19s/quepid/pull/1093


## 7.18.1 - 2024-11-01
## 7.18.1 - 2024-12-06

### Bugs
We've been hard at work on Quepid8, however we have two items that demand a point release:

* If you don't have `P@10` defined, the migrations blow up. Thanks @frutik for find the bug. https://github.com/o19s/quepid/pull/1093
* Bug fix when looking up potential Querqy rule use and we hadn't finished running the query. https://github.com/o19s/quepid/commit/cb9e3f4b4fce07c0acfc5301d7c00fcc7b7c8d23 by @epugh.

* Prevent run away querying! A user of Quepid has a proxy between Quepid and the search engine, and we were overloading it. https://github.com/o19s/quepid/commit/7cb1f55b7e2cf1f08c06f4d38a0ac3eb679450b4 by @mkr!

## 7.18.0 - 2024-10-04

Expand Down
43 changes: 22 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ GEM
railties (>= 6.0.0)
intercom-rails (1.0.1)
activesupport (> 4.0)
io-console (0.7.2)
io-console (0.8.0)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
Expand All @@ -223,7 +223,7 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (7.0.0)
railties (>= 3.2.16)
json (2.8.2)
json (2.9.0)
json-jwt (1.16.7)
activesupport (>= 4.2)
aes_key_wrap
Expand All @@ -243,7 +243,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
local_time (3.0.2)
logger (1.6.1)
logger (1.6.2)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -257,7 +257,7 @@ GEM
memory_profiler (1.1.0)
mini_histogram (0.3.1)
mini_mime (1.1.5)
minitest (5.25.1)
minitest (5.25.4)
minitest-reporters (1.7.1)
ansi
builder
Expand Down Expand Up @@ -292,11 +292,11 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.4)
nokogiri (1.16.7-aarch64-linux)
nokogiri (1.16.8-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
nokogiri (1.16.8-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
nokogiri (1.16.8-x86_64-linux)
racc (~> 1.4)
numo-narray (0.9.2.1)
oauth2 (2.0.9)
Expand Down Expand Up @@ -341,7 +341,8 @@ GEM
cmdstan (>= 0.2)
numo-narray (>= 0.9.1.7)
rover-df
psych (5.2.0)
psych (5.2.1)
date
stringio
public_suffix (6.0.1)
puma (6.5.0)
Expand Down Expand Up @@ -389,9 +390,9 @@ GEM
activesupport (>= 4.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.6.0)
rails-html-sanitizer (1.6.1)
loofah (~> 2.21)
nokogiri (~> 1.14)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (8.0.0)
actionpack (= 8.0.0)
activesupport (= 8.0.0)
Expand All @@ -405,28 +406,28 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.7.0)
rdoc (6.8.1)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.11)
regexp_parser (2.9.3)
reline (0.5.12)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.9)
rover-df (0.4.1)
numo-narray (>= 0.9.1.9)
rubocop (1.69.0)
rubocop (1.69.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.36.1, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.36.1)
rubocop-ast (1.36.2)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
Expand All @@ -449,7 +450,7 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
securerandom (0.3.2)
securerandom (0.4.0)
selenium-webdriver (4.27.0)
base64 (~> 0.2)
logger (~> 1.4)
Expand All @@ -465,12 +466,12 @@ GEM
snaky_hash (2.0.1)
hashie
version_gem (~> 1.1, >= 1.1.1)
solid_cable (3.0.2)
solid_cable (3.0.3)
actioncable (>= 7.2)
activejob (>= 7.2)
activerecord (>= 7.2)
railties (>= 7.2)
solid_queue (1.0.2)
solid_queue (1.1.0)
activejob (>= 7.1)
activerecord (>= 7.1)
concurrent-ruby (>= 1.3.1)
Expand Down Expand Up @@ -500,7 +501,7 @@ GEM
unicode-emoji (4.0.4)
uniform_notifier (1.16.0)
uri (1.0.2)
useragent (0.16.10)
useragent (0.16.11)
vega (0.4.0)
version_gem (1.1.4)
warden (1.2.9)
Expand Down
15 changes: 9 additions & 6 deletions app/assets/javascripts/controllers/searchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,16 @@ angular.module('QuepidApp')

$scope.querqyRuleTriggered = function () {
let triggered = false;
let parsedQueryDetails = $scope.query.searcher.parsedQueryDetails;

if (parsedQueryDetails.querqy?.rewrite !== undefined) { // jshint ignore:line
triggered = true;
}
else if ('querqy.infoLog' in parsedQueryDetails){
triggered = true;
if ($scope.query.searcher && $scope.query.searcher.parsedQueryDetails) {
let parsedQueryDetails = $scope.query.searcher.parsedQueryDetails;

if (parsedQueryDetails.querqy?.rewrite !== undefined) { // jshint ignore:line
triggered = true;
}
else if ('querqy.infoLog' in parsedQueryDetails){
triggered = true;
}
}

return triggered;
Expand Down
26 changes: 23 additions & 3 deletions app/assets/javascripts/services/queriesSvc.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,21 +785,41 @@ angular.module('QuepidApp')
return querySearchableDeferred.promise;
};

this.pAll = async function(queue, concurrency) {
let index = 0;
const results = [];

const worker = async () => {
while (index < queue.length) {
const curIndex = index++;
const promise = queue[curIndex]();
await promise;
results[curIndex] = promise;
}
};

const workers = [];
for (let workerIdx = 0; workerIdx < concurrency; workerIdx++) {
workers.push(worker());
}
await Promise.all(workers);
return Promise.all(results);
}

this.searchAll = function() {
let promises = [];
let scorePromises = [];

angular.forEach(this.queries, function(query) {
let promise = query.search().then( () => {
let searchPromiseFn = () => query.search().then(() => {
scorePromises.push(query.score());
});

promises.push(promise);
promises.push(searchPromiseFn);
});

// Holy nested promises batman
return $q.all(promises).then( () => {
return this.pAll(promises, 10).then( () => {
$q.all(scorePromises).then( () => {
/*
* Why are we calling scoreAll after we called score() above?
Expand Down

0 comments on commit 1e3114e

Please sign in to comment.