Git Product home page Git Product logo

google / taqo-paco Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 10.0 199.7 MB

Desktop and new mobile client apps for the Paco user behavior research platform (https://www.pacoapp.com/).

License: Apache License 2.0

Shell 1.93% Dart 71.94% Smarty 0.01% Makefile 0.46% Java 12.78% Kotlin 1.53% Ruby 2.38% Swift 3.99% Objective-C 1.00% CMake 0.77% C++ 0.69% C 0.19% Python 2.32%
user research-tool behavior paco

taqo-paco's Introduction

taqo_survey

A research tool for behavioral research. It is the next version of Paco.

It has been completely rewritten to be more modular and more easily runnable and maintainable across both mobile and desktop platforms.

The main app is in the taqo_client subdirectory, which contains a Flutter project. More information can be found in taqo_client/README.md.

The data_binding_builder subdirectory contains a Dart project that generates code for database-object connection. The instructions for running the builder is also in taqo_client/README.md. Since the generated files are also under version control, one does not need to run this builder unless the database-object relation described in this project is changed.

The pal_event_server directory is the desktop daemon that manages data and native interaction services, e.g., dbus, alarm scheduling, data storage interaction, event triggering, data uploading, etc.

Disclaimer

This is not an officially supported Google product.

taqo-paco's People

Contributors

bobevans avatar dileeps861 avatar orthros avatar rundong08 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

taqo-paco's Issues

palEventServer logging for missing .zshrc

Issue by BobEvans
Mon Jun 8 21:24:17 2020


Since it is not critical, let's log the missing .zshrc file differently

Current output:
FileSystemException: Cannot open file, path = '/home/user/.zshrc' (OS Error: No such file or directory, errno = 2)

Suggested improvement:
No .zshrc file found.

TespServer logging of errors

Issue by BobEvans
Sat Sep 12 08:36:22 2020


For diagnostic purposes, we should log more information in the TespServer. For instance, the recent JSON date serialization error which caused a silent close of the connection.

This will be even more useful as the other clients start sending data.

Create UI to email Experiment researcher (contact email) - Umbrella

Issue by BobEvans
Wed Dec 18 23:15:38 2019


This is a participant's primary contact with their researcher. It should be very easy to find. Arguably, each experiment in the Running Experiments view should have an email link icon on the list item line.

This link should jump to the platform-specific mail app with pre-filled email of the contact email, or, if missing, the creator email, from the experiment and subject line with the experiment title.

Get and store participant ID

Issue by mikemaksymowych
Wed Apr 1 20:11:55 2020


For experiments not joined by invitation we need to get the user's email address (currently is only exposed in the browser auth session)

Store these for later use in events.

Create Notification to participate in study - Umbrella

Issue by BobEvans
Wed Dec 18 22:43:31 2019


At a triggered moment during the course of an Experiment, whether due to a schedule or some trigger event, the app will pop up a notification in a platform's specific notification mechanism, e.g., notification shade, desktop notification, etc., to notify users to participate in a study. The notification should have an ID that can facilitate recall of which experiment and experiment group is currently notifying the user as there could be multiple concurrently.

The ID is used when opening the app from that notification to open the correct survey and carry along Trigger information (See Android NotificationHolder). (on Android it is passed as an Extra in the PendingIntent to the ExperimentExecutorActivity which is launchable).

The notification usually has a timeout value after which the notification is considered expired. When a notification expires, the platform's notification mechanism should be used to remove the notification display and the Taqo notification management should clean up this notification trace which also includes recording a missed signal Event in the EventStore.

Other notes, there may be multiple notifications because multiple groups within an experiment, or, across experiments are ready to receive input from the user.

One possible challenge is that writing it in Dart/Flutter will mean that it has to talk to native services to set and expire notifications (Android - AlarmManager,NotificationManager; iOS - NotificationManager,registering background work callbacks to expire notifications; macOS -?). This might mean that plugins to do local notifications in Flutter will not help with the expiration task because they cannot run in the background (unknown if this is accurate).

References:
Android Notification Service that creates and expires notifications
Android Notification Scheduling via AlarmManager
Android NotificationHolder for book keeping of outstanding notifications

On mobile, process allocation and package implications for sqlite.

Issue by BobEvans
Mon Mar 30 22:42:34 2020


This is a placeholder to remind us to look at any changes needed (since we are prioritizing desktop versions first).

Currently on iOS, everything calls back into the app, Taqo app frontend, SyncService, Notifications, (no app usage logger).

On Android, things run as separate services: AlarmManager, NotificationService, AppUsageLogger, SyncService, Taqo app foreground.

On Linux, there is the Taqo app and the Linux Daemon, where the palEventServer, notification and alarm management, and SyncService run.

On macOS, there is the Taqo app, and separate login agents for the PalEventServer and the AppUsageLogger, notifications call back into the app, SyncService should probably (or is already) running in the PalEventServer agent process.

EventServer Linux: investigate replacing Process.exec of gdbus with canonical's recently resumed dbus

Issue by BobEvans
Sat Sep 12 08:16:52 2020


It looks like Canonical has resumed their dbus client: https://github.com/canonical/dbus.dart.

This might be cleaner and more efficient than our current method of launching gdbus in a child process and might make it nicer for the client to register and activate itself on dbus: https://github.com/BobEvans/taqo_survey/issues/258.

Check LGPL acceptability.

IDE usage trigger not testing key value as well as cueSource.

Issue by BobEvans
Sat Jul 11 05:44:24 2020


The code in triggers.dart
137: cueFiltersMatch = ((event.sourceId?.isEmpty ?? true) && (interruptCue.cueSource?.isEmpty ?? true)) ||
(event.sourceId == interruptCue.cueSource);

needs to test key as well as cueSource if the type is IDE_IDEA_USAGE

Move shell logging to sqlite

Issue by mikemaksymowych
Tue Jun 16 17:58:09 2020


@BobEvans @rundong08, I was thinking about moving from the current command.log file to storing the CLI logs directly into sqlite; what do you think about that?

Advantages

  • sqlite3 has a simple CLI usage: sqlite3 db "insert into table(column) values(value);" that will integrate into the .bashrc file nicely
  • Will solve data race issues from multiple isolate/processes (client, daemon, logger isolate)

Disadvantages

  • ?

Note that this would be an intermediate table (not directly into events/outputs) and probably just have and _id and TEXT column

Log Apps Used on Platform Umbrella Issue (Android, macOS, Linux)

Issue by BobEvans
Wed Feb 19 20:09:45 2020


For Android, macOS, and Linux, set up a process to log the apps foregrounded.

The goal is to observe the focus change of apps and log the foregrounding of apps as Paco events. This will also be used as a stream of data for event-contingent triggering, i.e. create a notification prompt to fill out a survey when a particular app is used.

When an experiment has defined an app usage data collector, or, in the case of the event trigger on app start or stop, we should start a poller that runs when the user is actively logged in and samples the foreground app at a fine enough granularity to detect any change from previous app to new app. It should record this as a Paco event with a time stamp in the responseTime field.

Previous implementations.
-=-=-=-=-=
This is currently implemented in Android Paco using the Process Usage statistics.
https://github.com/google/paco/blob/develop/Paco/src/com/pacoapp/paco/sensors/android/procmon/LollipopAppUsageMonitor.java

In macOS, it is currently implemented as part of PAL using a launchd login agent that polls the Quartz system for the foreground window (and document - if a document-based app) every 250 ms.
https://github.com/BobEvans/pal/blob/develop/AppUsageLogger2/AppUsageLogger2/observer.swift.

We do not currently have a running version on Linux, let alone a process monitor. There are several ways to do it depending on the system. We should target gLinux.

Create indexes for SQLite database

Issue by rundong08
Tue Jun 2 18:06:54 2020


We can create indexes for some database columns to accelerate query speed.
Here are a (snapshot as of 2020-06-02) list of columns used in a where clause of a query:

alarms._id
notifications._id
notifications.experiment_id
events.uploaded
events._id
outputs.event_id
experiments.joined
experiments.id

Todo: think about securing client - palserver communication

Issue by BobEvans
Thu May 21 22:26:08 2020


For lack of a better place at the moment, I'll put this here. We need to ensure that IPC communication is secure enough to prevent a rogue server intercepting client events. For instance, if we ship the tesp client in a library for data analytics or research data collection, could someone cause a user of that library to send data to a fake research IPC server they have set up?

Android studio plugin compat error

Join an experiment with Taqo on linux using Google Android studio.

Launch Studio.

See error message:
Plugin Error: Plugin "PAL Dev Logger" is incompatible (supported only in IntelliJ IDEA).

iOS user adjusted text size can blow up layout on Running Experiments page

Issue by BobEvans
Thu Feb 27 22:51:15 2020


Enlarge text size on iPhone to 75% of scale (iOS 13.3.1) (settings/display and brightness)

Join an experiment.
Go to Running Experiments screen.

Notice:
The Experiment title ends up smaller than the organization label

Reset text size to 50%.

Notice the title is the same size as the organization.

One of these text fields scales differently.

Trigger App Start/Stop Survey Notification - Umbrella (macOS, Android, Linux)

Issue by BobEvans
Wed Feb 19 20:39:23 2020


Using the app usage logging functionality (https://github.com/BobEvans/taqo_survey/issues/93), evaluate each app change event to determine if an experiment triggers on that app starting or stopping (really gaining or losing foreground focus). If it matches the experiment trigger cue, then, according to the trigger notification action details, create a notification to participate in a survey.

The existing Android implementation, that takes into account minimum buffers between triggers and delay before notification, is across these files:
AppUsageMonitor that orchestrates logging and detecting app change states:
https://github.com/google/paco/blob/develop/Paco/src/com/pacoapp/paco/sensors/android/procmon/LollipopAppUsageMonitor.java

BroadcastTriggerService that manages experiment notifications on app usage events (this code is a mess):
https://github.com/google/paco/blob/4c78fe70faeca798c05ed91c6e92aa80f806252e/Paco/src/com/pacoapp/paco/sensors/android/BroadcastTriggerService.java#L71

Particularly, this part checks on minimum buffer and delayed notification:

https://github.com/google/paco/blob/4c78fe70faeca798c05ed91c6e92aa80f806252e/Paco/src/com/pacoapp/paco/sensors/android/BroadcastTriggerService.java#L139

Secure user data on macOS

Issue by rundong08
Fri Dec 13 22:20:42 2019


On iOS and Android, all the user data are written into a private container that other apps cannot access. On macOS although the user data are still written into a sandboxed container, that sandbox can be accessed from outside, namely at ~/Library/Containers/your.app.bundleId. This may cause privacy issues when the surveys are sensitive (e.g. health related). We need to secure user data on macOS (e.g. by encryption).

Note that not only the SQLite database, but also the files storing joined experiments, need to be protected. For example, one may infer a user's health condition based on which health related experiments the user has joined.

App Logger Linux - Using Wayland misses some app info

Issue by BobEvans
Wed Jun 17 05:40:22 2020


Not sure what the cause for some apps not getting logged.

I can see window focus events for Taqo and Firefox as I go back and forth between them but not for Terminal, or LibreOffice.

Maybe this has something to do with xprops sampling?

Also, it seems to be missing some tab focus events in Firefox.

Users have no hints for surveys longer than the screen

Issue by rundong08
Tue Jan 21 23:07:44 2020


In Paco, when the survey is longer than the screen, there will be a scrolling bar showing up, hinting the users there are more content. However, in current version of Taqo, the screen just looks as if there are no more content.

Evaluate going back to Unix Domain Sockets for event server IPC

Issue by BobEvans
Sat Sep 12 08:32:09 2020


As of Dart 2.7.2, there is support for unix domain sockets.

We should re-evaluate this option at some point.

Considerations include

  1. signing up to do new data-generating client implementations since we rewrote it using TCP sockets
    2)The new TESP server protocol and the ease of switching out the socket protocols.
  2. Will we want to support Windows before the support is in Dart.

Event Server.addEvents needs to generalize filling in the experiment info and group info for other sensor types

Issue by BobEvans
Sat Jul 18 05:48:58 2020


Recently, I updated addEvents to automatically figure out which experiments care about intelliJ events and rewrite the events to have the proper experiment and group info.

We should generalize this so that any new sensors which get turned on and start sending data to the local event server can be properly configured for each experiment that is listening to that sensor.

Also, this code is currently in TespServer but should really be somewhere else. Also, the appusage server and the shell server should route through the same shared code.

iOS - App doesn't close after notification->survey path

Issue by BobEvans
Fri Mar 6 21:45:28 2020


Create an experiment with a notification schedule.
Join the experiment on an iPhone (found on 13.3 iPhone 11 pro)
When notified to participate, tap on notification.
Fill out survey and save.
See the Feedback ("Thank you") page.
Tap the Checkbox Fab at bottom right.
Expectation: App closes when opened from a notification.
Actual: app does not close

Android studio plugin integration

The ide plugin location for android-studio in some environments is under ~/.local/share/Google/AndroidStudio---. Make sure the plugin checks there too.

Paused status not stored persistently on Android

Issue by rundong08
Thu Jun 18 18:12:55 2020


Steps to reproduce:
(1) (Optional) Change setExperimentPausedStatus in taqo_client/lib/storage/local_database.dart as

  @override
  Future<void> setExperimentPausedStatus(Experiment experiment, bool paused) async {
    await _db.update('experiments', {'paused': paused ? 1 : 0},
        where: 'id=?', whereArgs: [experiment.id]);
    var fieldsMaps = await _db.query('experiments', columns: ['paused'],
    where: 'id=?', whereArgs: [experiment.id]);
    _logger.info('setExperimentPausedStatus(${experiment.id}, $paused) result: ${fieldsMaps.single['paused']}');
  }

(2) Start taqo client in Android emulator
(3) Join an experiment
(4) Pause the experiment
(5) Examine the experiments.db file
(6) Restart the app, examine the paused status

Expected behavior:
for (5): paused status for experiment is 1
for (6): paused status should be maintained as paused.

Actual:
for (5): paused status for experiment is 0
for (6): paused status is running (not paused)

What is even more confusing here is the query and logging added in (1) shows that the status is stored in the database successfully.....

Create SyncService to handle EventUploading to Paco Server - Umbrella

Issue by BobEvans
Wed Aug 28 22:46:57 2019


The SyncService is responsible for uploading Event data from an EventStore to the Paco server whenever Event data should be uploaded. It should try to run whenever there is a need to upload (experiments may decide to not upload data at all). Typically, uploading is used whenever a new event is recorded. The saving of data into the EventStore should alert the sync service. Also, relevant system events, such as network becoming available, should wake the sync service so that it can upload any data recorded while offline. The Android SyncService is a working version of a SyncService.

The Paco Server protocol for event uploading is located in the https://github.com/google/paco/blob/develop/Paco-Server/src/com/google/sampling/experiential/server/EventServlet.java

It receives an array of Events and tries to save each one to its respective Experiment's data set.

It then produces a return object which is a JSON array in order with result objects for each corresponding uploaded Event.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.