Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/immich-app/immich. Pull mirroring updated .
  1. Jan 08, 2024
  2. Jan 07, 2024
    • Zack Pollard's avatar
    • Michael Manganiello's avatar
      fix(server): Split database queries based on PostgreSQL bound params limit (#6034) · e2622980
      Michael Manganiello authored
      * fix(server): Split database queries based on PostgreSQL bound params limit
      
      PostgreSQL uses a 16-bit integer to indicate the number of bound
      parameters.
      
      This means that the maximum number of parameters for any query is 65535.
      Any query that tries to bind more than that (e.g. searching by a list of
      IDs) requires splitting the query into multiple chunks.
      
      This change includes refactoring every Repository that runs queries
      using a list of ids, and either flattening or merging results.
      
      Fixes #5788, #5997.
      
      Also, potentially a fix for #4648 (at least based on
      [this comment](https://github.com/immich-app/immich/issues/4648#issuecomment-1826134027)).
      
      References:
      
      * https://github.com/typeorm/typeorm/issues/7565
      * [PostgreSQL message format - Bind](https://www.postgresql.org/docs/15/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-BIND)
      
      * misc: Create Chunked decorator to simplify implementation
      
      * feat: Add ChunkedArray/ChunkedSet decorators
      e2622980
    • maxer137's avatar
      feat(server): add postgres major version check (#6213) · 6835d451
      maxer137 authored
      
      * feat(server): Throw error when PostgreSQL version is not within the supported versions
      The pgvecto.rs extension, though not distributed, can be built for PostgreSQL 12 and 13.
      An installation of PostgreSQL 12 with the pgvecto.rs extensions installed will not be caught by immich.
      This causes immich to attempt to run the database migrations without having a proper environment.
      With assertPostgresql the server will throw an error if the PostgreSQL version is not within the supported range.
      
      * Replaced assertion with lesser than comparison
      As requested by @zackpollard
      
      * Changed the comparison to use the minPostgresVersion variable.
      If we define one we might as well use it. makes changing the versioning later easier
      
      * Added two new tests, modified two existing tests
      
      `should return if minimum supported PostgreSQL and vectors version are installed`:
      Check if init returns properly and that getPostgresVersion is called twice
      
      `should thrown an error if PostgreSQL version is below minimum supported version`:
      Checks if the init function correctly returns an error
      
      `should suggest image with postgres ${major} if database is ${major}`:
      Modified to set MockResolvedValue instead of MockResolvedValueOnce. With the new check we get the PostgreSQL version twice. So it needs to be set during the entire test.
      
      `should not suggest image if postgres version is not in 14, 15 or 16`:
      Modified the bounds to [14, 18]. Because values below 14 now will not get called.
      Also Modified to call `getPostgresVersion.MockResolvedValueOnce` for twice, because it gets called twice.
      
      * Fixed two mistakes in the jest functions from previous commit #2abcb60
      
      `should thrown an error if PostgreSQL version is below minimum supported version`:
      The regex function I wrote mistakingly used the negate function which check that the error *did not* contain the phrase "PostgreSQL". Which is the opposite
      
      `should not suggest image if postgres version is not in 14, 15 or 16`:
      confused bounds for a normal javascript array. Changed the test to only check for values above 16. As values below 14 will get thrown out by test `should return if minimum supported PostgreSQL and vectors version are installed`
      
      I apologise for the mistakes in my previous commit.
      
      * Format fix
      
      ---------
      
      Co-authored-by: default avatarmax <wak@vanling.net>
      6835d451
    • martin's avatar
      feat(web): auto switch theme (#6176) · 84e60ea1
      martin authored
      
      * move from app.html to user-page-layout.svelte
      
      * fix: use layout.svelte
      
      * simplify
      
      * fix: map style don't change
      
      * fix: auto switch theme map
      
      * use constants
      
      * simplify
      
      * rename
      
      * rename settign
      
      * fix: remove
      
      * pr feedback
      
      * fix: tests
      
      * fix: migration
      
      * fix: migration
      
      * pr feedback
      
      * simplify
      
      * simplify
      
      * pr feedback
      
      * fix: merge
      
      * chore: set insetad of toggle on click
      
      ---------
      
      Co-authored-by: default avatarJason Rasmussen <jrasm91@gmail.com>
      84e60ea1
  3. Jan 06, 2024
  4. Jan 05, 2024
  5. Jan 04, 2024
  6. Jan 03, 2024
  7. Jan 02, 2024
Loading