giseldo/neodataset huggingface dataset:
Support for implementing counter for System Push tool

<!---
Please read this!

The Definition of Ready (DoR) can be found at https://developers.minds.com/docs/handbook/how-we-work/#definition-of-ready-dor

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "Type::Feature" label and verify the feature you're about to submit isn't a duplicate.
--->

## Goal

<!---
Clearly outline the goal of the issue and why we are doing it
--->

Admins running the System Push Notification tool have no insights into the progress of the push notification. Record a counter and output to the interface

## What needs to be done

<!---
Clearly detail what needs to be done to achieve the goal set out above
--->

We already have a column called 'counter' in the schema that isn't doing anything. Update this (throttle to every 200 sends) and return in the entity export. 

## QA

<!---
Consideration is given to how the issue will be demoed and tested prior to being deployed
--->

N/A

## UX/Design

<!---
Sufficient wireframes have been presented and understood by the development team. Full mockups are not required and re-usable components are encouraged.
--->


## Personas

<!---
Who does this user impact and why (optional)
--->

All users

## Experiments

<!---
Experiments are not required, but it should be made clear if one is expected. If experiments are required, the hypothesis should be outlined.
--->

N/A

## Acceptance Criteria

<!--
Everyone should be able to understand what is expected to be delivered
--->

- [ ] Implement a counter
- [ ] Show in the admin GUI tool
- [ ] Spec tests

## Definition of Ready Checklist

- [x] Definition Of Done (DoD)
- [x] Acceptance criteria
- [ ] Weighted
- [x] QA
- [x] UX/Design
- [x] Personas
- [x] Experiments

Support

Story points: 2.0
New deep link endpoint needed for Android 12


## Goal

Android 12 introduced a breaking change to deep-linking, it now requires an endpoint to validate that you control the domain. (Similar to what iOS does)

## What needs to be done

We need to create an endpoint for .well-known/assetlinks.json to validate the domain on Android 12

## QA

We need to build an APK pointing the deep linking to the domain of the sandbox

## UX/Design

-


## Personas

It will fix the deep links for all the users running the app on Android 12 devices


## Experiments

-

## Acceptance Criteria

- [ ] the endpoint .well-known/assetlinks.json must return the required information
- [ ] Deeplink should work on Android 12 devices

## Definition of Ready Checklist

- [ ] Definition Of Done (DoD)
- [ ] Acceptance criteria
- [ ] Weighted
- [ ] QA
- [ ] UX/Design
- [ ] Personas
- [ ] Experiments

Story points: 2.0
SearchIndexDispatcher CrashLoopBackOff

<!---
Please read this!

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "T - Bug" label and verify the issue you're about to submit isn't a duplicate.
--->

### Summary

minds-runner-search-index-dispatcher CrashLoopBackOff

### Steps to reproduce

N/A

### Platform information 

Runners

### What is the current *bug* behavior?

Search indexer stuck in CrashLoopBackOff

### What is the expected *correct* behavior?

Should work normally

### Relevant logs and/or screenshots

```
Minds.CRITICAL: TypeError: trim(): Argument #1 ($string) must be of type string, array given in /var/www/Minds/engine/Core/Search/Mappings/EntityMapping.php:206 Stack trace: #0 /var/www/Minds/engine/Core/Search/Mappings/EntityMapping.php(206): trim(Array, ' \t\n\r\x00\v#') #1 [internal function]: Minds\Core\Search\Mappings\EntityMapping->Minds\Core\Search\Mappings\{closure}(Array) #2 /var/www/Minds/engine/Core/Search/Mappings/EntityMapping.php(207): array_map(Object(Closure), Array) #3 /var/www/Minds/engine/Core/Search/Mappings/ActivityMapping.php(34): Minds\Core\Search\Mappings\EntityMapping->map(Array) #4 /var/www/Minds/engine/Core/Search/Index.php(80): Minds\Core\Search\Mappings\ActivityMapping->map() #5 /var/www/Minds/engine/Core/Search/Events.php(86): Minds\Core\Search\Index->index(Object(Minds\Entities\Activity)) #6 [internal function]: Minds\Core\Search\Events->Minds\Core\Search\{closure}(Object(Minds\Core\Events\Event)) #7 /var/www/Minds/engine/Core/Events/Dispatcher.php(144): call_user_func_array(Object(Closure), Array) #8 /var/www/Minds/engine/Core/Events/EventsDispatcher.php(49): Minds\Core\Events\Dispatcher::trigger('search:index:di...', 'all', Array, NULL) #9 /var/www/Minds/engine/Core/Queue/Runners/SearchIndexDispatcher.php(32): Minds\Core\Events\EventsDispatcher->trigger('search:index:di...', 'all', Array) #10 /var/www/Minds/engine/Core/Queue/SQS/Client.php(159): Minds\Core\Queue\Runners\SearchIndexDispatcher->Minds\Core\Queue\Runners\{closure}(Object(Minds\Core\Queue\Message)) #11 /var/www/Minds/engine/Core/Queue/Runners/SearchIndexDispatcher.php(33): Minds\Core\Queue\SQS\Client->receive(Object(Closure)) #12 /var/www/Minds/engine/Controllers/Cli/QueueRunner.php(32): Minds\Core\Queue\Runners\SearchIndexDispatcher->run() #13 /var/www/Minds/engine/cli.php(64): Minds\Controllers\Cli\QueueRunner->run() #14 {main} 	{"exception":"[object] (TypeError(code: 0): trim(): Argument #1 ($string) must be of type string, array given at /var/www/Minds/engine/Core/Search/Mappings/EntityMapping.php:206)"} 

```
```
dba@cqlsh:minds> select * from entities where key='1078886937977348096' and column1='tags';;

 key                 | column1 | value
---------------------+---------+--------------------------------------
 1078886937977348096 |    tags | [["socialmedia"],["videostreaming"]]
```

### Possible fixes

-  Scale up runners
- Fix underlying issue

Story points: 1.0
The social compass endpoint is returning information even without an active session



### Summary

The social compass is returning information without valid credentials. Because of this, the compass is randomly shown on mobile when the tokens are expired. (Even for users that already answered it)

Endpoint https://www.minds.com/api/v3/social-compass/questions

### Steps to reproduce

Get request without credentials to https://www.minds.com/api/v3/social-compass/questions

### Platform information 

API

### What is the current *bug* behavior?

It is returning the social compass information without an active session (answersProvided: false)

### What is the expected *correct* behavior?

it should return a 401

### Relevant logs and/or screenshots

![Screen_Shot_2022-05-10_at_16.42.32](/uploads/f923160f7a800400b8162ae25d473f55/Screen_Shot_2022-05-10_at_16.42.32.png)

### Possible fixes

Check for session

Story points: 1.0
Handle custom data dimensions for paywalled vids

<!---
Please read this!

The Definition of Ready (DoR) can be found at https://developers.minds.com/docs/handbook/how-we-work/#definition-of-ready-dor

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "Type::Feature" label and verify the feature you're about to submit isn't a duplicate.
--->

## Goal

<!---
Clearly outline the goal of the issue and why we are doing it
--->

Video dimensions are only being exported for un-paywalled vids, likely related to Cloudflare webhook. 

We need to be able to access height and width of videos to implement the activity-v2 designs (without the height and width, we show black bars on either side of the video).

## What needs to be done

<!---
Clearly detail what needs to be done to achieve the goal set out above
--->

Move the `->acl->setIgnore(true)` step to be **before** the entities builder step. The issue is that the webhook doesn't have permission to view the entity. 

## QA

<!---
Consideration is given to how the issue will be demoed and tested prior to being deployed
--->

Difficult to test in sandboxes due to webhook configurations. 

## UX/Design

<!---
Sufficient wireframes have been presented and understood by the development team. Full mockups are not required and re-usable components are encouraged.
--->

N/A

## Personas

<!---
Who does this user impact and why (optional)
--->

Creators. 

## Experiments

<!---
Experiments are not required, but it should be made clear if one is expected. If experiments are required, the hypothesis should be outlined.
--->

N/A

## Acceptance Criteria

<!--
Everyone should be able to understand what is expected to be delivered
--->

- [ ] Minds+ videos have dimensions exported

## Definition of Ready Checklist

- [x] Definition Of Done (DoD)
- [x] Acceptance criteria
- [ ] Weighted
- [] QA
- [x] UX/Design
- [x] Personas
- [x] Experiments

Story points: 1.0
All trimmed videos revert to original state when uploading to Minds

<!---
Please read this!

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "T - Bug" label and verify the issue you're about to submit isn't a duplicate.
--->

### Summary

Given the user is on the iOS app, and the user has a video that they've trimmed using the iOS Photos app, when the user uploads the video to Minds, then the un-edited version of the video is uploaded.

### Steps to reproduce

- Record a video on iPhone (with screen recorder, or the iPhone camera app)
- Open the video in the iOS Photos app and edit the video with the trim tool. Click `Done` > `Save video`
- Launch the Minds app and create a post
- Upload the video you've just trimmed

### Platform information 

- iOS app

### What is the current *bug* behavior?

- The un-edited version of the video is uploaded

### What is the expected *correct* behavior?

- The edited version of the video is uploaded

### Relevant logs and/or screenshots

I made a sample screen recording, starting at Home screen > Minds app > Home screen.

- [Sample video](https://drive.google.com/file/d/1TWmEGFad8r5xQhYGhs7nz8guspJmz25E/view?usp=sharing)

I think used the iOS Photos app to trim it, removing the Home screen sections.

- [Sample video: Trimmed](https://drive.google.com/file/d/1rSJTj2Li_0MVHqoZ0MXEu_riF4DSrn38/view?usp=sharing)

Trimming the video in the Photos app. The preview shows the Home screen sections which I had trimmed out of the video.

![IMG_D6DC01124C72-1](/uploads/9e6fe938f77daa96e93a6c8da7cf41eb/IMG_D6DC01124C72-1.jpeg)

Then uploaded the video through the Minds iOS app -- 

![IMG_EB4ADAC5653B-1](/uploads/dcf54d1b021168bce1ef51e80f1d1c97/IMG_EB4ADAC5653B-1.jpeg)

### Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Story points: 3.0
Implement ability to resolve other DID's

<!---
Please read this!

The Definition of Ready (DoR) can be found at https://developers.minds.com/docs/handbook/how-we-work/#definition-of-ready-dor

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "Type::Feature" label and verify the feature you're about to submit isn't a duplicate.
--->

## Goal

<!---
Clearly outline the goal of the issue and why we are doing it
--->

We need to be able to read other DID documents to continuing our Self Sovereign Identity goal. 

## What needs to be done

<!---
Clearly detail what needs to be done to achieve the goal set out above
--->

There are a **lot** of did methods, and maintaining our own drivers for each is going to be a mammoth task. Luckily, https://github.com/decentralized-identity/universal-resolver exists which supports most methods we would want to work with, at least for the initial phase. 

### Universal Resolver

- ~Launch https://github.com/decentralized-identity/universal-resolver as microservice~ <- Use https://https://dev.uniresolver.io/ for first phase, then launch our own later
- PHP to proxy the universal resolver
- Provide a simple API endpoint that will resolve 3rd party DID's


## QA

<!---
Consideration is given to how the issue will be demoed and tested prior to being deployed
--->

Provide a curl script to QA

## UX/Design

<!---
Sufficient wireframes have been presented and understood by the development team. Full mockups are not required and re-usable components are encouraged.
--->

N/A

## Personas

<!---
Who does this user impact and why (optional)
--->

Everyone

## Experiments

<!---
Experiments are not required, but it should be made clear if one is expected. If experiments are required, the hypothesis should be outlined.
--->

N/A


## Acceptance Criteria

<!--
Everyone should be able to understand what is expected to be delivered
--->

- [x] ~Launch [https://github.com/decentralized-identity/universal-resolver] as a microservice. Build helm chart if necessary~ <- To reduce scope, just use https://dev.uniresolver.io/ but have support for chaning endpoint
- [x] This should work on Sandboxes
- [x] PHP proxy and public api endpoint
- [x] Curl script that QA can use to verify the implementation
- [x] Spec tests

## Definition of Ready Checklist

- [x] Definition Of Done (DoD)
- [x] Acceptance criteria
- [x] Weighted
- [x] QA
- [x] UX/Design
- [x] Personas
- [x] Experiments

Story points: 8.0
Store Email 2FA Codes Outside of Redis

<!---
Please read this!

The Defintion of Ready (DoR) can be found at https://developers.minds.com/docs/handbook/how-we-work/#definition-of-ready-dor

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "Type::Feature" label and verify the feature you're about to submit isn't a duplicate.
--->

## Goal

<!---
Clearly outline the goal of the issue and why we are doing it
--->

Following our recent incident with 2FA codes failing to be understood as valid, we should investigate alternative ways to store 2FA codes for validation.

## What needs to be done

<!---
Clearly detail what needs to be done to achieve the goal set out above
--->

Prior to starting work on this issue, we should first identity where we want to store the codes and how we want to retrieve them. After this, we can make the changes to engine.

## QA

<!---
Consideration is given to how the issue will be demoed and tested prior to being deployed
--->

- Ensure email two factor codes still send

## Acceptance Criteria

<!--
Everyone should be able to understand what is expected to be delivered
--->

- [ ] Store the two factor secret part in Cassandra instead of Redis
- [ ] Spec tests
- [ ] Cassandra schema AND TTL support

## Definition of Ready Checklist

- [x] Definition Of Done (DoD)
- [x] Acceptance criteria
- [ ] Weighted
- [ ] QA

Story points: 5.0
Channel Recommendations See More section is empty but the top recommendation panel still continues to see new recommendations

### Summary

See More page is empty but I still see new channel recommendations after refreshing the page. 

### Steps to reproduce

1. Open minds + turn on experiment.
1. Navigate to a channel with no post.
1. View the top Recommendations.
1. Tap on See More and subscribe to all until no more see more recommendations.
1. Now, go back to profile after refresh.
1. Notice that three top recommendations are still there as expected.
1. Subscribe to the top 3 recommendations now.
1. Notice that see more is empty still.
1. Go back to profile and refresh.
1. Notice that new top 3 recommendations have showed up which never existed in See more option. This is an inconsistency issue.

### Platform information 

Chrome - All browsers

### What is the current *bug* behavior?

See More is empty but recommendations are still available. 

### What is the expected *correct* behavior?

Data inconsistency issue. We should have channels under see more section if recommendations are still available. 

### Relevant logs and/or screenshots

![ChannelRecBug](/uploads/ffca7fc08ebf245738d2cb9eca483563/ChannelRecBug.mov)

Story points: 3.0
As a user, I want to have a web DID

## Goal

The [Web](https://w3c-ccg.github.io/did-method-web/) method is a good candidate for kicking off our Self Sovereign Identity project.

## What needs to be done

### DID Document Schema

eg.
```
{
  "@context": "https://www.w3.org/ns/did/v1",
  "id": "did:web:minds.com",
  "verificationMethod": [{
     "id": "did:web:minds.com#controller",
     "type": "Secp256k1VerificationKey2018",
     "controller": "did:web:minds.com",
     ...
  }],
  "authentication": [
     "did:web:minds.com#controller"
  ]
}

```

### DID .well-known endpoint

**did:web:minds.com:mark** should resolve to https://www.minds.com/mark/.well-known/did.json

### Helpful Links
https://w3c-ccg.github.io/did-method-web/
https://learn.mattr.global/tutorials/dids/did-web

### Key management

We require a simple key/value repository that a public key and private key for a user. This can be determined during sprint.

## Acceptance Criteria

- [x] Implement the DID web spec
- [x] Provide documentation as to how this works, and how it can be tested (https://developers.minds.com/docs/walk-throughs/did)
- [x] Deliver a very simple prototype that will resolve a web did.
- [x] Expose the users DID in their about section

Story points: 8.0
Top feed not pulling in 150 items

<!---
Please read this!

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "T - Bug" label and verify the issue you're about to submit isn't a duplicate.
--->

### Summary

`https://www.minds.com/api/v3/newsfeed/feed/unseen-top` is not pulling in 150 items. Often it appears to be only about 25.

### Steps to reproduce

Do api request to `https://www.minds.com/api/v3/newsfeed/feed/unseen-top`

### Platform information 

API

### What is the current *bug* behavior?

Less than the limit is consistently being returned depsite there being available items.

### What is the expected *correct* behavior?

- A limit of 150 posts
- Return an ordered newsfeed
- If the unseen part is preventing a full list being returned, then we should change the logic. Instead of excluding 'seen' posts, try to reduce their score so they show lower in the rankings.

### Relevant logs and/or screenshots

N/A

### Possible fixes

...

Story points: 3.0
Improve efficiency of holding rewards calculations

<!---
Please read this!

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "T - Bug" label and verify the issue you're about to submit isn't a duplicate.
--->

### Summary

Implement the result of the investigation at https://gitlab.com/minds/front/-/issues/5423

### Acceptance criteria

- BigQuery driver (@fausto.arci -> `composer require google/cloud-bigquery`)
- Write out query to get all token holders
- Change process of holding reward calcs to use BigQuery instead
- Tests
- Dry run via CLI (check it still works)

Story points: 5.0
Verified link broken in Apple mobile browser

<!---
Please read this!

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "T - Bug" label and verify the issue you're about to submit isn't a duplicate.
--->

Verified link broken in Apple mobile browser

User reported the "click here to request to be verified" link did not do anything on her Apple mobile browser

![1](/uploads/8e012a0bbd9cae0e07d6fbeb63f66b56/1.png)![2](/uploads/8386524286be1820c0848c36d83dad96/2.png)produce the issue - this is very important)

### Platform information 

unknown browser, iphone

Story points: 2.0
Refactor `moderation_reports_by_state` materialized view to use secondary indexes instead

## Issue

Cassandra has consistency issues with Materialized Views. The report queue is reported by admins as being broken every couple months. We fix this by **dropping** the materialized view and recreating it.

## Proposal

Secondary Indexes work well for low-cardinality fields. As there are only a small number of states (reported, initial_jury, appealed, etc, it should work well.

## Acceptance criteria

- Support Secondary Indexes on the `moderation_reports` table for the `state` column
- Refactor `moderation_reports_by_state` to use `moderation_reports`

Story points: 1.0
Introduce FriendlyCaptcha backend services

FriendlyCaptcha is an open source captcha system. Their backend is currently centralized, but the widget allows you to change the endpoint (https://docs.friendlycaptcha.com/#/verification_api).

## Acceptance Criteria

- Replace our captcha system with FriendlyCaptcha
- Ensure we are not relying on any 3rd parties and that we are using our own endpoints
- The cypress captcha bypass still works

Story points: 5.0
(bug): minds/phpspec container fails when executing backend tests locally with minds phpspec command

<!---
Please read this!

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "T - Bug" label and verify the issue you're about to submit isn't a duplicate.
--->

### Summary

When executing the backend tests using the local Minds CLI as described [here](https://developers.minds.com/docs/getting-started/installation/#running-test-suite), I receive the following error:

```bash
Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "../phpspec.sh": permission denied: unknown
```

The Dockerfile for this container attempts to execute the script with its `ENTRYPOINT` instruction, however the file is not marked as executable. To resolve this we can prefix the command with `sh` in the `ENTRYPOINT` exec list.

After resolving this, the run still fails as at least one of the tests are using type declarations which are not supported with PHP 7.3 (the current version specified for the parent image).

```bash
Parse error: syntax error, unexpected 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /var/www/Minds/engine/vendor/symfony/event-dispatcher-contracts/Event.php on line 33
```

To resolve this, we could update the parent image to to `minds/php:8.0`. After a global search on the project it seems to me that the `minds/phpspec` container is only used by the local CLI, however I would appreciate feedback on this in case I missed anything.

### Steps to reproduce

To reproduce, you can run `minds rebuild && minds phpspec`. For me this fails in `master`, but all tests pass with my suggested changes.

### Platform information 

I'm using Linux Mint 20.3 (Ubuntu 20.04) for this, however I would think that these issues are platform agnostic.

### What is the current *bug* behavior?

Backend tests fail when executing them with the local Minds CLI (`minds phpspec`).

### What is the expected *correct* behavior?

All tests should pass when executing the above command.

Story points: 2.0
IOS App , Minds + , scroll down error

When I visited Minds + page from IOS App, I wanted to scroll down and up, the titles of posts position were crashed. I attached a screenshot.

NerdyMind 

![1320F8E4-3253-4EFF-B9E6-9252DA180D6A](/uploads/df77e1ed657680f8871c1b29e029f9e0/1320F8E4-3253-4EFF-B9E6-9252DA180D6A.png)

Story points: 2.0
Video upload broken on locals and sandboxes

<!---
Please read this!

Before opening a new issue, make sure to search for keywords in the issues
filtered by the "T - Bug" label and verify the issue you're about to submit isn't a duplicate.
--->

### Summary

Possible permissions error - see chat for error message.

### Steps to reproduce

Try to upload a video on sandbox.

### Platform information 

Sandbox / Local stacks.

### What is the current *bug* behavior?

Bucket error.

### What is the expected *correct* behavior?

Should allow upload.

### Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)

### Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Story points: 3.0