Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior of licenses - user_metadata #1100

Open
kosarko opened this issue Jan 18, 2024 · 2 comments
Open

Strange behavior of licenses - user_metadata #1100

kosarko opened this issue Jan 18, 2024 · 2 comments

Comments

@kosarko
Copy link
Member

kosarko commented Jan 18, 2024

Originally in v5, if I've filled in user metadata for license:

v5_behavior.mp4

the transaction linked only to the current metadata, i.e. the above video resulted in:

dspace5l_licenses=# select * from license_resource_mapping join license_resource_user_allowance USING(mapping_id) join user_metadata USING(transaction_id) where license_id = 22 and created_on >= '2024-01-18';
 transaction_id | mapping_id | bitstream_id | license_id | active | eperson_id |         created_on         |              token               | user_metadata_id | eperson_id | metadata_key |       metadata_value
----------------+------------+--------------+------------+--------+------------+----------------------------+----------------------------------+------------------+------------+--------------+-----------------------------
           8077 |       1285 |          774 |         22 | t      |        880 | 2024-01-18 16:44:40.904457 | xxx_some_token_xxx |            31008 |        880 | COUNTRY      | CR
           8077 |       1285 |          774 |         22 | t      |        880 | 2024-01-18 16:44:40.904457 | xxx_some_token_xxx |            31009 |        880 | EXTRA_EMAIL  | redacted_email@example.com
           8077 |       1285 |          774 |         22 | t      |        880 | 2024-01-18 16:44:40.904457 | xxx_some_token_xxx |            31010 |        880 | ADDRESS      | Nekde v Praze
           8077 |       1285 |          774 |         22 | t      |        880 | 2024-01-18 16:44:40.904457 | xxx_some_token_xxx |            31011 |        880 | NAME         | Franta BU
           8077 |       1285 |          774 |         22 | t      |        880 | 2024-01-18 16:44:40.904457 | xxx_some_token_xxx |            31012 |        880 | IP           | 10.10.1.83 

While in v7, a similar task:

v7_behavior.mp4

Stores much more values (probably from history)

select count(*) from license_resource_mapping join license_resource_user_allowance USING(mapping_id) join user_metadata USING(transaction_id) where license_id = 78 and created_on >= '2024-01-18 16:19';
 count
-------
   122
(1 row)


dspace=# select count(*) from license_resource_mapping join license_resource_user_allowance USING(mapping_id) join user_metadata USING(transaction_id) where license_id = 78 and created_on >= '2024-01-18 16:19' and metadata_key = 'NAME';
 count
-------
     6
(1 row)

select metadata_key, metadata_value, created_on from license_resource_mapping join license_resource_user_allowance USING(mapping_id) join user_metadata USING(transaction_id) where license_id = 78 and created_on >= '2024-01-18 16:19' and metadata_key = 'NAME';
 metadata_key | metadata_value |       created_on
--------------+----------------+-------------------------
 NAME         | filatko        | 2024-01-18 16:19:58.511
 NAME         | filatko        | 2024-01-18 16:19:58.511
 NAME         | test           | 2024-01-18 16:19:58.511
 NAME         | test           | 2024-01-18 16:19:58.511
 NAME         | No ORG, WTF    | 2024-01-18 16:19:58.511
 NAME         | TEST USER NAME | 2024-01-18 16:19:58.511
(6 rows)

dspace=# select metadata_key, metadata_value, created_on from license_resource_mapping join license_resource_user_allowance USING(mapping_id) join user_metadata USING(transaction_id) where license_id = 78 and created_on >= '2024-01-18 16:19' and metadata_key = 'INTENDED_USE';
 metadata_key | metadata_value |       created_on
--------------+----------------+-------------------------
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
 INTENDED_USE | Sell for $$$   | 2024-01-18 16:19:58.511
@kosarko
Copy link
Member Author

kosarko commented Apr 15, 2024

@milanmajchrak To opakovani hodnot uz se nedeje, ale cekal bych, ze se do user_metadata ulozi i IP adresa. Nebo to se deje az kdyz kliknu na link v mailu? Na gmail aktualne maily nechodi, ale koukam, ze IP na dspace-devu neni ulozena u niceho:

dspace=# select distinct metadata_key from user_metadata;
     metadata_key
-----------------------
 INTENDED_USE
 REQUIRED_ORGANIZATION
 NAME
 SEND_TOKEN
(4 rows)

@milanmajchrak
Copy link
Collaborator

@kosarko Môžem potvrdiť, IP adresa sa neuklada, vytvorim issue a budeme na tom pracovať.
dataquest-dev/dspace-angular#602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants