community-core-procs.tcl

  • last updated 9 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Deprecate 'acs_user::get_element' in favor of 'acs_user::get'

Put get_by_username in the proper cache, handle cases when we delete a user that was not in the cache (in this case we could not retrieve authority and username after deletion)

Fix typo

Unify person update api, exploit cache better and remove unneded queries

  1. … 1 more file in changeset.
No need to check as now person::name won't fail

Fix expression

Parties api had procs defined in both acs-subsite and acs-tcl and sometimes duplicated

- move all party:: api into acs-tcl/tcl/community-core-procs

- remove duplicated definitions

- move leftover deprecated proc to deprecated-procs.tcl

  1. … 4 more files in changeset.
Second revision of the party/person/user api

- split api into 3 caches for party/person/user

- new *_info procs for the specific object type: stresses only specific cache and is therefore faster when only specific info is needed

    • -138
    • +313
    ./community-core-procs.tcl
  1. … 1 more file in changeset.
Don't be so quick on deprecating a common interface

Draft reform of the caching for party descendant types (persons, users, groups)

- new proc party::get to centralize caching of the various information for a party descendant scattered through tables

- allow to retrieve only a single value from the dict in new and existing api

- rename of user_info_cache with party_info_cache

- replacement into previously existing api

Behavior for the new proc now will be to not fail, just return an empty dict or an empty value when no party is found

TODO: after review of the change, replacement of all now deprecated calls in code around

    • -133
    • +267
    ./community-core-procs.tcl
  1. … 2 more files in changeset.
Fix typo

Whitespace cleanup

Employ new user cache also for portrait information

Don't cache invalid user ids, as they might become valid shortly after (e.g. during registration)

Remove unneded dict creation

  1. … 1 more file in changeset.
Modernize idiom

Restore previous behavior: when a person is not found by email, just return empty string instead of an error

Reduce code duplication when retrieving person info

TODO centralize caching

  1. … 1 more file in changeset.
provide compatibility with AOLserver

make timeout cnd cache size configurable

follow usual naming conventions

  1. … 1 more file in changeset.
Pass to a ns_cache implementation to avoid race conditions

Implement acs_user:: cache through nsv, instead of the util_memoize cache. Note that now this information won't expire anymore unless explicitly flushed.

Remove unnecessary backslashes, remove leftover usages of get_from_username_not_cached cache, minimize catch wrapping

Reuse acs_user::get_by_username to retrieve user_id in order to reduce query duplication and cache entries for acs_user::get, simplify idiom

  1. … 1 more file in changeset.
Revert massive replacement of empty list creation sentences. The use of '[list]' instead of '{}' adds semantics that could be used for performance improvements in the future, such as using a different internal representation. There is already work in this direction, avoiding the generation of the string representation during comparison of empty strings (huge thanks to Stefan Sobernig for the pointer: https://core.tcl.tk/tcl/info/44527c632ed609c2).

  1. … 475 more files in changeset.
Prefer '{}' to '[list]' when creating empty lists

  1. … 71 more files in changeset.
improve documentation

  1. … 10 more files in changeset.
Use acs_magic_object instead of acs_lookup_magic_object

  1. … 1 more file in changeset.
Portrait management reform and correction

Moved logics to create a portrait in a proc in order to reuse it in other places

such as picture retrieval services (e.g. Bach picture retrieval at WU). Turns out

we were not doing our homeworks here: when the portrait is created into CR, a

cr_child_rel is created. When the portrait was erased though, this was not cleaned

up propely, leaving dangling acs_objects with no reference in cr_child_rels table.

On busy sites, this can grow in the ten thousands order of magnitude. Changes include

also fix for this behavior and tuples cleanup.

  1. … 16 more files in changeset.
Move deprecated procs into deprecated-procs.tcl

  1. … 10 more files in changeset.
Small improvement for portrait management (deletion)

Exploit existing on delete cascade constraints when we delete a portrait, instead of deleting stuff manually.

Also, put remaining logics into a proc and use it in acs_user::delete to address legit use case of people wanting

to remove a user permanently without removing portrait in advance.

  1. … 2 more files in changeset.