a free (libre) open source, mobile OS for Ethereum https://status.im
Go to file
Icaro Motta 206730a777
Show "Added to group chat" notifications (#14785)
Partially implements https://github.com/status-im/status-mobile/issues/14712
Fixes #14744

### Summary

This PR implements the first, among what will probably be many different kinds of membership notifications. For this PR, I started with implementing a particular flow for private group chats because it's already supported by `status-go` (albeit I had to make some changes, see [PR in status-go](https://github.com/status-im/status-go/pull/3088).

1. `A` and `B` are mutual contacts.
2. `A` creates a private group chat with `B` as member.
3. `B` sees the group chat in the app, but doesn't interact with it.
4. `B` reinstalls the app (remember to back up the seed phrase).
5. `A` mentions `B` in the group chat.
6. `B` should see a group chat notification, which can be accepted/declined.

- [x] Also fixes #14744

### Demo

In the video I'm simulating the steps outlined in the *Summary*, but using the approach described in *Steps to test*, because it's way easier to iterate during development.

[demo.webm](https://user-images.githubusercontent.com/46027/212470798-c135d229-948d-4ba5-98db-ee73cc5495cd.webm)

### Review Notes

Some changes had to be made in `status-go` ([PR](https://github.com/status-im/status-go/pull/3088)), namely:

- According to [Figma](https://www.figma.com/file/eDfxTa9IoaCMUy5cLTp0ys/Shell-for-Mobile?node-id=3806%3A586901&t=xLTAjLXjG1UtorpI-0), users should be able to see `accepted` group chat notifications. Until now, `status-go` hardcoded that `accepted` notifications would *not* be returned in query results, and so it would be impossible to show them to users. This was changed and now the RPC endpoint accepts an additional filter. The implementation on the backend is backwards compatible so as to not break Status desktop.
- The `Membership` tab needs to display various types of notifications (group chat, community, etc), but the membership type doesn't exist on the backend. To overcome this constraint, this PR makes the membership type a logical/virtual type, i.e. a Clojure set of types. `status-go` was changed to support querying for multiple notification types (also backwards compatible).

#### Platforms

- Android
- iOS

### Steps to test

Please, follow the steps described in the Summary and you should be able to test.

But during development, I followed these steps (recommended by @cammellos). I documented them here for reference.

1. Checkout `feature/e2e` in status-go. Apply the diff below.
2. `cd cmd/e2e && ./e2e`
3. This will create a temporary account automatically, let's call it `A`.
4. On another device, create account `B`.
5. Follow the steps documented in bdc406ea2e/cmd/e2e/README.md (L2) in order for user `A` to create a group chat with `B` as member. Don't make `A` and `B` mutual contacts.
6. On `B`'s device, a notification should appear, and `B` should be able to accept or decline the "invitation" (actually *invitation* is another concept and related to another feature).

```diff
modified   cmd/e2e/main.go
@@ -283,6 +283,11 @@ func defaultNodeConfig(installationID string) (*params.NodeConfig, error) {
    nodeConfig.NetworkID = 1
    nodeConfig.LogLevel = "ERROR"
    nodeConfig.DataDir = "/ethereum/mainnet_rpc"
+        nodeConfig.HTTPEnabled = true
+        nodeConfig.HTTPPort = 8545
+        nodeConfig.HTTPHost = "localhost"
+        nodeConfig.HTTPVirtualHosts = []string{"localhost"}
+
         nodeConfig.APIModules = "wakuext,ext,waku"

    nodeConfig.UpstreamConfig = params.UpstreamRPCConfig{
modified   protocol/messenger_group_chat.go
@@ -26,17 +26,17 @@ func (m *Messenger) validateAddedGroupMembers(members []string) error {
        }

        contact, _ := m.allContacts.Load(contactID)
-		if contact == nil || !(contact.Added && contact.HasAddedUs) {
-			return ErrGroupChatAddedContacts
-		}
+                if contact == nil {
+                  contact, err = buildContactFromPkString(contactID)
+                  if err != nil {
+                    return err
+                  }
+                }
    }
    return nil
 }

 func (m *Messenger) CreateGroupChatWithMembers(ctx context.Context, name string, members []string) (*MessengerResponse, error) {
-	if err := m.validateAddedGroupMembers(members); err != nil {
-		return nil, err
-	}

    var response MessengerResponse
    logger := m.logger.With(zap.String("site", "CreateGroupChatWithMembers"))
```
2023-01-23 13:54:51 -03:00
.clj-kondo Move unit test helper namespace to `src/test_helpers/` (#14716) 2023-01-05 11:58:37 -03:00
.dependabot [Fixes: #11518] Fix dependabot directory 2020-12-07 12:14:16 +01:00
.github drop unused zenhub github actions workflows 2022-08-01 16:11:38 +02:00
android Add `code-snippet` component (#14275) 2022-11-03 10:55:33 +03:00
ci e2e: more fixes 2023-01-18 16:02:09 +01:00
doc Move unit test helper namespace to `src/test_helpers/` (#14716) 2023-01-05 11:58:37 -03:00
fastlane e2e: move to EU datacenter 2022-10-20 10:07:29 +02:00
ios [#14689] Link previews in chat (#14771) 2023-01-18 22:43:26 +01:00
modules/react-native-status abstract running code in separate thread for native java modules (#14690) 2023-01-05 14:42:39 +05:30
nix [#14689] Link previews in chat (#14771) 2023-01-18 22:43:26 +01:00
resources Add Collectible ui component (#14803) 2023-01-18 19:00:47 +01:00
scripts new structure continue, move utils, move fx macro to re-frame utils n… (#14373) 2022-11-16 09:09:25 +01:00
src Show "Added to group chat" notifications (#14785) 2023-01-23 13:54:51 -03:00
test e2e: offline messages + edit 2023-01-19 19:01:14 +01:00
test-resources make sure nodejs uses a fixed timezone (#14793) 2023-01-16 16:34:15 +05:30
translations Show "Added to group chat" notifications (#14785) 2023-01-23 13:54:51 -03:00
visual-test feat: add component tests using react-testing-library and jest (#14331) 2022-11-23 05:59:18 -08:00
.buckconfig upgrade react-native and packages - but broken 2016-04-24 15:07:08 +07:00
.carve_ignore move constants/config to status-im2 root and remove old constants/config (#14821) 2023-01-18 15:43:58 +01:00
.detoxrc.js Visual tests setup (#14329) 2022-11-20 15:46:04 -08:00
.dockerignore Create Nix package for building status-go 2019-04-09 12:44:39 +02:00
.env UI for mobile to mobile local pairing - updated (#14514) 2022-12-16 18:40:56 +05:30
.env.e2e UI for mobile to mobile local pairing - updated (#14514) 2022-12-16 18:40:56 +05:30
.env.jenkins UI for mobile to mobile local pairing - updated (#14514) 2022-12-16 18:40:56 +05:30
.env.nightly Enable waku2 by default 2022-12-15 12:39:49 +00:00
.env.release Enable waku2 by default 2022-12-15 12:39:49 +00:00
.envrc Add login integration test 2022-06-08 13:43:32 +01:00
.eslintrc.js Upgrade react-native to 0.60.5 2019-09-12 16:13:42 +02:00
.flowconfig RN 63 and xcode12 2021-01-14 09:41:38 +01:00
.gitattributes Desktop branch merged into develop (#5266) 2018-07-23 18:21:31 +03:00
.gitignore chore: add some component tests (#14511) 2022-12-13 14:19:20 -08:00
.mailmap fix my name 2019-02-28 14:50:42 +01:00
.nycrc add coverage test 2019-07-10 16:15:44 -04:00
.prettierrc.js feat: add messages gap component (#13860) 2022-09-05 15:58:35 +08:00
.watchmanconfig Ensure shell.nix uses same nixpkgs as the rest of the environment 2019-06-20 09:18:24 -04:00
.zprintrc New component Selector > Filter (#14650) 2022-12-28 12:21:15 -03:00
LICENSE.md Create LICENSE.md 2016-09-21 10:00:44 +08:00
Makefile chore: fix component tests and permission drawer preview (#14831) 2023-01-19 15:03:53 -08:00
README.md Document new guidelines (#14309) 2022-11-14 07:15:49 -03:00
RELEASES.md notes: updated release notes 2022-08-29 13:54:45 +02:00
VERSION fix ens name turns into public key while editing message (#14149) 2022-10-14 17:35:36 +05:30
app.json update react-native and project dependencies 2017-12-15 16:06:13 +01:00
babel.config.js feat: add component tests using react-testing-library and jest (#14331) 2022-11-23 05:59:18 -08:00
binding.gyp Add status-go tests 2022-05-25 17:59:02 +01:00
default.nix nix: minor cleanup and documentation updates 2020-06-05 14:49:34 +02:00
index.js Implement Wallet Connect 2.0 2022-03-17 03:46:38 -03:00
metro.config.js Implement Wallet Connect 2.0 2022-03-17 03:46:38 -03:00
package.json New make target to run tests via REPL (#14576) 2022-12-20 09:07:00 -03:00
react-native.config.js Implement Wallet Connect 2.0 2022-03-17 03:46:38 -03:00
shadow-cljs.edn cleanup setup (#14827) 2023-01-19 12:15:28 +01:00
shell.nix nix: minor cleanup and documentation updates 2020-06-05 14:49:34 +02:00
status-go-version.json Show "Added to group chat" notifications (#14785) 2023-01-23 13:54:51 -03:00
supervisord.conf Add docker-compose for development build 2018-04-11 14:58:38 +01:00
yarn.lock New make target to run tests via REPL (#14576) 2022-12-20 09:07:00 -03:00

README.md

Status - a Mobile Ethereum Operating System

Get it on Google Play Get it on F-Droid Get it on Github

Join us in creating a browser, messenger, and gateway to a decentralized world. Status is a free (libre) open source mobile client targeting Android & iOS built entirely on Ethereum technologies. That's right, no middle men and go-ethereum running directly on your device.

Getting started with Status

Why?

We believe in a medium of pure free trade, economies with fair, permission-less access and a world without intermediaries. We want to create policies that can exist between friends or scale globally, we want to communicate securely and be uninhibited by legacy systems.

We want to take responsibility for our data, the way we conduct ourselves privately and promote this way of life to a mass audience.

We want deep insights into our own economies so we can make informed, data-driven decisions on how to make our lives better. The Ethereum blockchain, Smart Contracts, Swarm and Whisper provides us a path forward.

If this interests you, help us make Status a reality - anyone can contribute and we need everyone at any skill level to participate.

How to Contribute?

Go straight to the docs or join our chat and choose what interests you:

  • Developer Developers are the heart of software and to keep Status beating we need all the help we can get! If you're looking to code in ClojureScript or Golang then Status is the project for you! We use React Native and there is even some Java/Objective-C too! Want to learn more about it? Start by reading our Developer Introduction which guides you through the technology stack and start browsing beginner issues. Then you can read how to Build Status, which talks about managing project dependencies, coding guidelines and testing procedures. The doc/ directory also has valuable information for contributors.

  • Community Management Metcalfe's law states that the value of a network is proportional to the square of the number of connected users of the system - without community Status is meaningless. We're looking to create a positive, fun environment to explore new ideas, experiment and grow the Status community. Building a community takes a lot of work but the people you'll meet and long lasting relationships you form will be well worth it, check out our Mission and Community Principles

  • Specification / Documentation John Dewey once said "Education is not preparation for life; education is life itself ". Developers & Designers need guidance and it all starts from documentation and specifications. Our software is only as good as its documentation, head over to our docs and see how you can improve what we have.

  • Blog Writing Content is King, keeping our blog up to date and informing the community of news helps keep everyone on the same page. Jump into our chat and discuss with the team how you can contribute!

  • Testers It's bug hunting season! Status is currently under active development and there is sure to be a bunch of learning, build status from scratch or if an android user check out our nightly builds. You can shake your phone to submit bug reports, or start browsing our Github Issues. Every bug you find brings Status closer to stable, usable software for everyone to enjoy!

  • Security Status is a visual interface to make permanent changes on the Blockchain, it handles crypto-tokens that have real value and allows 3rd party code execution. Security is paramount to its success. You are given permission to break Status as hard as you can, as long as you share your findings with the community!

  • Evangelism Help us spread the word! Tell a friend right now, in fact tell everyone - yell from a mountain if you have to, every person counts! If you've got a great story to tell or have some interesting way you've spread the word about Status let us know about it in our chat

Status API

View our API Docs and learn how to integrate your DApp into Status. You can read more about how to add your DApp to Status here.

Give me Binaries!

You can get our Beta builds for both Android and iOS on our website, through our nightly builds or by building it yourself.

Core Contributors

Core Team Members

Special thanks to @adrian-tiberius. Without the dedication of these outstanding individuals, Status would not exist.

Contact us

Feel free to email us at support@status.im or better yet, join our chat.

License

Licensed under the Mozilla Public License v2.0

Testing Supported by

BrowserStack Status