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

Initial work on v2 with activity #4900

Merged
merged 5 commits into from
Dec 12, 2019
Merged

Initial work on v2 with activity #4900

merged 5 commits into from
Dec 12, 2019

Conversation

tobiasKaminsky
Copy link
Member

@tobiasKaminsky tobiasKaminsky commented Nov 29, 2019

This is a very very first version of our new v2 library, which uses dav4jvm and okhttp.

This uses new GetActivitiesRemoteOperation with a NextcloudClient, as this is not critical.

Please have first look at it, @AndyScherzinger @ezaquarii
Same goes for nextcloud/android-library#361

We use default timeouts from OKHTTP:

  • connect: 10s
  • read: 10s
  • write: 10s
  • overall 60s

Fixes #4987

Signed-off-by: tobiasKaminsky tobias@kaminsky.me

@@ -55,6 +56,8 @@

OwnCloudClient create(User user) throws CreationException;

NextcloudClient createNextcloudClient(User user) throws CreationException;
Copy link
Collaborator

@ezaquarii ezaquarii Nov 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreationException is marked as @Deprecated.

I think it's rather kludgy to fail with exceptions in general. Many developers don't even know how to handle exceptions or care about handling them, using try-catch block to suppress them (sic!):

try {
    veryImportantThng = makeStuff();
} catch(VeryNastyException ex) {
   log(ex);
}
continue and probably crash later

Maybe we can return a client that fast-fails the operation? This way we can remove a lot of checks in the client code and make it safer:

  1. no edge cases
  2. no null handling

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea, let us discuss this in a new issue, even better in and https://github.com/nextcloud/android-library/

My intention of this PR was merely a c&p to get new v2 library up and running, so I would rather keep changes small.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11948.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot
Copy link
Collaborator

Codacy

327

Lint

TypemasterPR
Warnings7373
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings70
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings106
Security Warnings44
Dodgy code Warnings136
Total409

@codecov
Copy link

codecov bot commented Dec 12, 2019

Codecov Report

Merging #4900 into master will increase coverage by 0.02%.
The diff coverage is 7.69%.

@@             Coverage Diff              @@
##             master    #4900      +/-   ##
============================================
+ Coverage     17.75%   17.78%   +0.02%     
  Complexity        3        3              
============================================
  Files           385      385              
  Lines         32682    32675       -7     
  Branches       4593     4593              
============================================
+ Hits           5804     5812       +8     
+ Misses        25949    25932      -17     
- Partials        929      931       +2
Impacted Files Coverage Δ Complexity Δ
...oud/android/ui/activity/NotificationsActivity.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...va/com/nextcloud/client/network/ClientFactory.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ava/com/owncloud/android/jobs/NotificationJob.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...loud/android/ui/activities/ActivitiesActivity.java 0% <ø> (ø) 0 <0> (ø) ⬇️
.../ui/activities/data/files/FilesServiceApiImpl.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ncloud/android/ui/adapter/ActivityListAdapter.java 3.55% <ø> (ø) 0 <0> (ø) ⬇️
...es/data/activities/RemoteActivitiesRepository.java 100% <ø> (ø) 0 <0> (ø) ⬇️
...roid/ui/adapter/ActivityAndVersionListAdapter.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...oud/android/ui/activities/ActivitiesPresenter.java 80.64% <ø> (ø) 0 <0> (ø) ⬇️
...perations/DetectAuthenticationMethodOperation.java 0% <0%> (ø) 0 <0> (ø) ⬇️
... and 11 more

@AndyScherzinger AndyScherzinger mentioned this pull request Dec 12, 2019
@tobiasKaminsky tobiasKaminsky merged commit 257ac81 into master Dec 12, 2019
@delete-merged-branch delete-merged-branch bot deleted the v2withActivity branch December 12, 2019 07:10
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.10.0 milestone Dec 12, 2019
tobiasKaminsky added a commit that referenced this pull request Dec 13, 2019
10789e9 Merge pull request #4932 from nextcloud/useTestOrchestrator
50a73b4 on smaller displays we have to swipe up
9fce154 Use android test orchestrator
cbf59eb Merge pull request #4983 from nextcloud/disableGoogleTracking
e8eae2a disable google test tracking
257ac81 Merge pull request #4900 from nextcloud/v2withActivity
a235718 fix tests
6eb4ac7 revert to master snapshot
8b61e74 remove unneeded accountManager
e5cd5ff use nextcloudClient.execute(…)
066f4c2 Initial work on v2 with activity
45f1146 [tx-robot] updated from transifex
d913950 daily dev 20191211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symbol error
4 participants