Merge branch 'next-minor' into develop

This commit is contained in:
Benjamin Neff 2021-08-16 00:24:47 +02:00
commit e2b96c81f2
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
9 changed files with 21 additions and 13 deletions

View file

@ -43,6 +43,7 @@ Although the chat was never enabled per default and was marked as experimental,
* Fix html-syntax in some handlebars templates [#8251](https://github.com/diaspora/diaspora/pull/8251) * Fix html-syntax in some handlebars templates [#8251](https://github.com/diaspora/diaspora/pull/8251)
* Remove `chat_enabled` flag from archive export [#8265](https://github.com/diaspora/diaspora/pull/8265) * Remove `chat_enabled` flag from archive export [#8265](https://github.com/diaspora/diaspora/pull/8265)
* Change thumbnails in image slideshow to squares [#8275](https://github.com/diaspora/diaspora/pull/8275) * Change thumbnails in image slideshow to squares [#8275](https://github.com/diaspora/diaspora/pull/8275)
* Replace uglifier with terser for JS compression [#8268](https://github.com/diaspora/diaspora/pull/8268)
## Bug fixes ## Bug fixes

View file

@ -47,7 +47,7 @@ gem "sidekiq-cron", "1.2.0"
# Compression # Compression
gem "uglifier", "4.2.0" gem "terser", "1.1.5"
# Configuration # Configuration

View file

@ -721,6 +721,8 @@ GEM
temple (0.8.2) temple (0.8.2)
terminal-table (1.8.0) terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1) unicode-display_width (~> 1.1, >= 1.1.1)
terser (1.1.5)
execjs (>= 0.3.0, < 3)
thor (1.1.0) thor (1.1.0)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (2.0.10) tilt (2.0.10)
@ -747,8 +749,6 @@ GEM
ethon (>= 0.9.0) ethon (>= 0.9.0)
tzinfo (1.2.9) tzinfo (1.2.9)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.7) unf_ext (0.0.7.7)
@ -918,13 +918,13 @@ DEPENDENCIES
sprockets-es6 (= 0.9.2) sprockets-es6 (= 0.9.2)
sprockets-rails (= 3.2.2) sprockets-rails (= 3.2.2)
string-direction (= 1.2.2) string-direction (= 1.2.2)
terser (= 1.1.5)
timecop (= 0.9.4) timecop (= 0.9.4)
toml-rb (= 2.0.1) toml-rb (= 2.0.1)
turbo_dev_assets (= 0.0.2) turbo_dev_assets (= 0.0.2)
twitter (= 7.0.0) twitter (= 7.0.0)
twitter-text (= 3.1.0) twitter-text (= 3.1.0)
typhoeus (= 1.4.0) typhoeus (= 1.4.0)
uglifier (= 4.2.0)
unicorn (= 6.0.0) unicorn (= 6.0.0)
unicorn-worker-killer (= 0.4.5) unicorn-worker-killer (= 0.4.5)
uuid (= 2.3.9) uuid (= 2.3.9)

View file

@ -442,8 +442,13 @@ class User < ApplicationRecord
aq = self.aspects.create(:name => I18n.t('aspects.seed.acquaintances')) aq = self.aspects.create(:name => I18n.t('aspects.seed.acquaintances'))
if AppConfig.settings.autofollow_on_join? if AppConfig.settings.autofollow_on_join?
default_account = Person.find_or_fetch_by_identifier(AppConfig.settings.autofollow_on_join_user) begin
self.share_with(default_account, aq) if default_account default_account = Person.find_or_fetch_by_identifier(AppConfig.settings.autofollow_on_join_user)
share_with(default_account, aq)
rescue DiasporaFederation::Discovery::DiscoveryError
logger.warn "Error auto-sharing with #{AppConfig.settings.autofollow_on_join_user}
fix autofollow_on_join_user in configuration."
end
end end
aq aq
end end

View file

@ -12,7 +12,9 @@ module Workers
person = Person.find_or_fetch_by_identifier(account) person = Person.find_or_fetch_by_identifier(account)
# also, schedule to fetch a few public posts from that person # also, schedule to fetch a few public posts from that person
Diaspora::Fetcher::Public.queue_for(person) unless person.nil? Diaspora::Fetcher::Public.queue_for(person)
rescue DiasporaFederation::Discovery::DiscoveryError
# Ignored
end end
end end
end end

View file

@ -27,7 +27,7 @@ Rails.application.configure do
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
# Compress JavaScripts and CSS. # Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier config.assets.js_compressor = :terser
# config.assets.css_compressor = :sass # config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed. # Do not fallback to assets pipeline if a precompiled asset is missed.

View file

@ -30,7 +30,7 @@ class BookmarkletRenderer
def compile def compile
src = File.read(source) src = File.read(source)
@body = Uglifier.compile(src) @body = Terser.compile(src)
FileUtils.mkdir_p cached_path.dirname FileUtils.mkdir_p cached_path.dirname
File.open(cached_path, "w") {|f| f.write(@body) } File.open(cached_path, "w") {|f| f.write(@body) }
end end

View file

@ -797,10 +797,10 @@ describe User, type: :model do
context "with autofollow sharing enabled" do context "with autofollow sharing enabled" do
it "should start sharing with autofollow account" do it "should start sharing with autofollow account" do
AppConfig.settings.autofollow_on_join = true AppConfig.settings.autofollow_on_join = true
AppConfig.settings.autofollow_on_join_user = "one" person = FactoryBot.build(:person)
AppConfig.settings.autofollow_on_join_user = person.diaspora_handle
expect(Person).to receive(:find_or_fetch_by_identifier).with("one")
expect(Person).to receive(:find_or_fetch_by_identifier).with(person.diaspora_handle).and_return(person)
user.seed_aspects user.seed_aspects
end end
end end

View file

@ -11,7 +11,7 @@ describe Workers::FetchWebfinger do
end end
it "should webfinger and queue no job to fetch public posts if the person is not found" do it "should webfinger and queue no job to fetch public posts if the person is not found" do
allow(Person).to receive(:find_or_fetch_by_identifier).and_return(nil) allow(Person).to receive(:find_or_fetch_by_identifier).and_raise DiasporaFederation::Discovery::DiscoveryError
expect(Diaspora::Fetcher::Public).not_to receive(:queue_for) expect(Diaspora::Fetcher::Public).not_to receive(:queue_for)