From 229f5d1681577c60e2aa0ab7240c5115acd9434a Mon Sep 17 00:00:00 2001 From: Shlee Date: Wed, 11 Aug 2021 04:56:13 +0800 Subject: [PATCH 1/2] NodeJS 14 support - circleci/docker/.nvmrc (#16163) * Update config.yml * Update Dockerfile * Update .nvmrc * Update Dockerfile * NodeJS 10 is EOL. * Update package.json * Update README.md * Update Vagrantfile * Update Dockerfile * Update Dockerfile --- .circleci/config.yml | 2 +- .nvmrc | 2 +- Dockerfile | 4 ++-- Vagrantfile | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 42c0582958c..bfded07debe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -209,7 +209,7 @@ jobs: test-webui: <<: *defaults docker: - - image: circleci/node:12-buster + - image: circleci/node:14-buster steps: - *attach_workspace - run: diff --git a/.nvmrc b/.nvmrc index 48082f72f08..8351c19397f 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -12 +14 diff --git a/Dockerfile b/Dockerfile index 8279e873595..fb596fdbfed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ FROM ubuntu:20.04 as build-dep # Use bash for the shell SHELL ["/bin/bash", "-c"] -# Install Node v12 (LTS) -ENV NODE_VER="12.21.0" +# Install Node v14 (LTS) +ENV NODE_VER="14.17.4" RUN ARCH= && \ dpkgArch="$(dpkg --print-architecture)" && \ case "${dpkgArch##*-}" in \ diff --git a/Vagrantfile b/Vagrantfile index 4d0cc0f7621..82d41f7d57b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -12,7 +12,7 @@ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - sudo apt-add-repository 'deb https://dl.yarnpkg.com/debian/ stable main' # Add repo for NodeJS -curl -sL https://deb.nodesource.com/setup_12.x | sudo bash - +curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - # Add firewall rule to redirect 80 to PORT and save sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port #{ENV["PORT"]} From 13b08610a08faf2909f7c871be62da955d9293d3 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 11 Aug 2021 16:40:55 +0200 Subject: [PATCH 2/2] Fix crash when encountering invalid account fields (#16598) * Add test * Fix crash when encountering invalid account fields --- app/models/account.rb | 6 +++++- spec/services/activitypub/process_account_service_spec.rb | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/account.rb b/app/models/account.rb index a6d8d153744..f7a7f4a7b44 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -295,7 +295,11 @@ class Account < ApplicationRecord end def fields - (self[:fields] || []).map { |f| Field.new(self, f) } + (self[:fields] || []).map do |f| + Field.new(self, f) + rescue + nil + end.compact end def fields_attributes=(attributes) diff --git a/spec/services/activitypub/process_account_service_spec.rb b/spec/services/activitypub/process_account_service_spec.rb index 56e7f83211b..1b1d878a7e6 100644 --- a/spec/services/activitypub/process_account_service_spec.rb +++ b/spec/services/activitypub/process_account_service_spec.rb @@ -12,6 +12,7 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do attachment: [ { type: 'PropertyValue', name: 'Pronouns', value: 'They/them' }, { type: 'PropertyValue', name: 'Occupation', value: 'Unit test' }, + { type: 'PropertyValue', name: 'non-string', value: ['foo', 'bar'] }, ], }.with_indifferent_access end