diff --git a/.app_version b/.app_version index 3edc695d..b38e1e76 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.27.2 +0.27.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b489bcb..234b872c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +# 0.27.3 - 2025-06-05 + +## Changed + +- Added `PGSSENCMODE=disable` to the development environment to resolve sqlite3 error. #1326 #1331 + +## Fixed + +- Fixed rake tasks to be run with `bundle exec`. #1320 +- Fixed import name not being set when updating an import. #1269 + +## Added + +- LocationIQ can now be used as a geocoding service. Set `LOCATIONIQ_API_KEY` to configure it. #1334 + + # 0.27.2 - 2025-06-02 You can now safely remove Redis and Sidekiq from your `docker-compose.yml` file, both containers, related volumes, environment variables and container dependencies. @@ -256,7 +272,7 @@ Also, after updating to this version, Dawarich will start a huge background job - Fixed a bug with an attempt to write points with same lonlat and timestamp from iOS app. #1170 - Importing GeoJSON files now saves velocity if it was stored in either `velocity` or `speed` property. -- `rake points:migrate_to_lonlat` should work properly now. #1083 #1161 +- `bundle exec rake points:migrate_to_lonlat` should work properly now. #1083 #1161 - PostGIS extension is now being enabled only if it's not already enabled. #1186 - Fixed a bug where visits were returning into Suggested state after being confirmed or declined. #848 - If no points are found for a month during stats calculation, stats are now being deleted instead of being left empty. #1066 #406 @@ -303,7 +319,7 @@ If you have encountered problems with moving to a PostGIS image while still on P ## Fixed -- `rake points:migrate_to_lonlat` task now works properly. +- `bundle exec rake points:migrate_to_lonlat` task now works properly. # 0.25.8 - 2025-04-24 @@ -358,7 +374,7 @@ This is optional feature and is not required for the app to work. ## Changed -- `rake points:migrate_to_lonlat` task now also tries to extract latitude and longitude from `raw_data` column before using `longitude` and `latitude` columns to fill `lonlat` column. +- `bundle exec rake points:migrate_to_lonlat` task now also tries to extract latitude and longitude from `raw_data` column before using `longitude` and `latitude` columns to fill `lonlat` column. - Docker entrypoints are now using `DATABASE_NAME` environment variable to check if Postgres is existing/available. - Sidekiq web UI is now protected by basic auth. Use `SIDEKIQ_USERNAME` and `SIDEKIQ_PASSWORD` environment variables to set the credentials. @@ -415,12 +431,12 @@ volumes: ``` -In this release we're changing the way import files are being stored. Previously, they were being stored in the `raw_data` column of the `imports` table. Now, they are being attached to the import record. All new imports will be using the new storage, to migrate existing imports, you can use the `rake imports:migrate_to_new_storage` task. Run it in the container shell. +In this release we're changing the way import files are being stored. Previously, they were being stored in the `raw_data` column of the `imports` table. Now, they are being attached to the import record. All new imports will be using the new storage, to migrate existing imports, you can use the `bundle exec rake imports:migrate_to_new_storage` task. Run it in the container shell. This is an optional task, that will not affect your points or other data. Big imports might take a while to migrate, so be patient. -Also, you can now migrate existing exports to the new storage using the `rake exports:migrate_to_new_storage` task (in the container shell) or just delete them. +Also, you can now migrate existing exports to the new storage using the `bundle exec rake exports:migrate_to_new_storage` task (in the container shell) or just delete them. If your hardware doesn't have enough memory to migrate the imports, you can delete your imports and re-import them. @@ -441,7 +457,7 @@ If your hardware doesn't have enough memory to migrate the imports, you can dele ## Fixed - Moving points on the map now works correctly. #957 -- `rake points:migrate_to_lonlat` task now also reindexes the points table. +- `bundle exec rake points:migrate_to_lonlat` task now also reindexes the points table. - Fixed filling `lonlat` column for old places after reverse geocoding. - Deleting an import now correctly recalculates stats. - Datetime across the app is now being displayed in human readable format, i.e 26 Dec 2024, 13:49. Hover over the datetime to see the ISO 8601 timestamp. @@ -451,7 +467,7 @@ If your hardware doesn't have enough memory to migrate the imports, you can dele ## Fixed -- Fixed missing `rake points:migrate_to_lonlat` task. +- Fixed missing `bundle exec rake points:migrate_to_lonlat` task. # 0.25.2 - 2025-03-21 @@ -462,9 +478,9 @@ If your hardware doesn't have enough memory to migrate the imports, you can dele ## Added -- `rake data_cleanup:remove_duplicate_points` task added to remove duplicate points from the database and export them to a CSV file. -- `rake points:migrate_to_lonlat` task added for convenient manual migration of points to the new `lonlat` column. -- `rake users:activate` task added to activate all users. +- `bundle exec rake data_cleanup:remove_duplicate_points` task added to remove duplicate points from the database and export them to a CSV file. +- `bundle exec rake points:migrate_to_lonlat` task added for convenient manual migration of points to the new `lonlat` column. +- `bundle exec rake users:activate` task added to activate all users. ## Changed diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index 0e28d3b4..2ac0b6ef 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -83,7 +83,7 @@ class ImportsController < ApplicationController end def import_params - params.require(:import).permit(:source, files: []) + params.require(:import).permit(:name, :source, files: []) end def create_import_from_signed_id(signed_id) diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index ddeab5d8..bef39599 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -4,8 +4,6 @@ class ApplicationJob < ActiveJob::Base # Automatically retry jobs that encountered a deadlock # retry_on ActiveRecord::Deadlocked - retry_on Exception, wait: :polynomially_longer, attempts: 25 - # Most jobs are safe to ignore if the underlying records are no longer available # discard_on ActiveJob::DeserializationError end diff --git a/config/database.yml b/config/database.yml index 75004309..26448dc5 100644 --- a/config/database.yml +++ b/config/database.yml @@ -12,7 +12,8 @@ default: &default sqlite_default: &sqlite_default adapter: sqlite3 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 10 } %> - timeout: 5000 + retries: 100 + default_transaction_mode: IMMEDIATE development: primary: diff --git a/config/initializers/01_constants.rb b/config/initializers/01_constants.rb index 30584e9d..494f1116 100644 --- a/config/initializers/01_constants.rb +++ b/config/initializers/01_constants.rb @@ -23,6 +23,8 @@ NOMINATIM_API_HOST = ENV.fetch('NOMINATIM_API_HOST', nil) NOMINATIM_API_KEY = ENV.fetch('NOMINATIM_API_KEY', nil) NOMINATIM_API_USE_HTTPS = ENV.fetch('NOMINATIM_API_USE_HTTPS', 'true') == 'true' +LOCATIONIQ_API_KEY = ENV.fetch('LOCATIONIQ_API_KEY', nil) + GEOAPIFY_API_KEY = ENV.fetch('GEOAPIFY_API_KEY', nil) STORE_GEODATA = ENV.fetch('STORE_GEODATA', 'true') == 'true' # /Reverse geocoding settings diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb index e813b8e4..adbf4c52 100644 --- a/config/initializers/geocoder.rb +++ b/config/initializers/geocoder.rb @@ -23,6 +23,9 @@ elsif NOMINATIM_API_HOST.present? settings[:lookup] = :nominatim settings[:nominatim] = { use_https: NOMINATIM_API_USE_HTTPS, host: NOMINATIM_API_HOST } settings[:api_key] = NOMINATIM_API_KEY if NOMINATIM_API_KEY.present? +elsif LOCATIONIQ_API_KEY.present? + settings[:lookup] = :location_iq + settings[:api_key] = LOCATIONIQ_API_KEY end Geocoder.configure(settings) diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index eaadf2f5..d3c7f1cd 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -9,6 +9,8 @@ ENV RAILS_ENV=development ENV SELF_HOSTED=true ENV SIDEKIQ_USERNAME=sidekiq ENV SIDEKIQ_PASSWORD=password +# Resolving sqlite3 error +ENV PGSSENCMODE=disable RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ wget \ diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 14f30548..511d5f68 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -1,7 +1,7 @@ # frozen_string_literal: true namespace :import do - # Usage: rake import:big_file['/path/to/file.json','user@email.com'] + # Usage: bundle exec rake import:big_file['/path/to/file.json','user@email.com'] desc 'Accepts a file path and user email and imports the data into the database' task :big_file, %i[file_path user_email] => :environment do |_, args| diff --git a/spec/requests/imports_spec.rb b/spec/requests/imports_spec.rb index 502bcca4..8bb53480 100644 --- a/spec/requests/imports_spec.rb +++ b/spec/requests/imports_spec.rb @@ -177,6 +177,7 @@ RSpec.describe 'Imports', type: :request do it 'updates the import' do patch import_path(import), params: { import: { name: 'New Name' } } + expect(import.reload.name).to eq('New Name') expect(response).to redirect_to(imports_path) end end