Page MenuHomePhabricator

Kotlin, lazy execution & multipart requests
Changes PlannedPublic

Authored by CLOVIS on Sep 26 2018, 1:49 PM.

Details

Summary

Conversion to Kotlin, multipart support and lazy-execution of requests

Fixes T266
Fixes T259
Fixes T267

Test Plan

Run unit tests

Diff Detail

Repository
rLIBWFJVA WildFyre Java Libary
Branch
T266-lazy-requests (branched from master)
Lint
Lint ErrorsExcuse: Multipart is currently broken, need to find why
Unit
No Unit Test Coverage
Build Status
Buildable 528
Build 528: arc lint + arc unit

Event Timeline

CLOVIS created this revision.Sep 26 2018, 1:49 PM
CLOVIS planned changes to this revision.Sep 26 2018, 1:50 PM

Tests are broken until D184 is landed. This is a preview of what's going on.

CLOVIS marked 2 inline comments as done.Sep 26 2018, 1:52 PM
CLOVIS added inline comments.
src/main/java/net/wildfyre/http/Request.kt
105

@Info-Screen What should I put as the 'name' for the eventual JSON parameters in the multipart request?

114

Same question, what should I put as the 'name' and 'filename' for the file that gets included ?

CLOVIS marked an inline comment as done.Sep 27 2018, 3:25 PM
CLOVIS added inline comments.
src/main/java/net/wildfyre/http/Request.kt
114
CLOVIS edited the summary of this revision. (Show Details)Sep 27 2018, 3:27 PM
CLOVIS edited the summary of this revision. (Show Details)
CLOVIS updated this revision to Diff 681.Oct 5 2018, 8:11 PM
  • Removed empty line
  • Merged master & fixed database identification bugs
CLOVIS retitled this revision from Added support for Kotlin to Kotlin, lazy execution & multipart requests.Oct 5 2018, 8:12 PM
CLOVIS marked 3 inline comments as not done.
CLOVIS edited the summary of this revision. (Show Details)Oct 5 2018, 8:15 PM

This revision contains setup modification, and therefore blocks tasks that use Kotlin.

CLOVIS updated this revision to Diff 693.Oct 12 2018, 2:27 PM
  • Cleaning the code
CLOVIS marked 3 inline comments as done.Oct 12 2018, 3:34 PM
CLOVIS added inline comments.
src/main/java/net/wildfyre/http/Request.kt
118

What should I put as the name of the file @Info-Screen ?

Info-Screen added inline comments.Oct 20 2018, 3:07 PM
src/main/java/net/wildfyre/http/Request.kt
105

normally you send the name of the field you have the value for here

114

name as above. filename doesn't matter, but normally this is intended to contain the filename (so the name of the file on the local system).

CLOVIS marked 2 inline comments as done.Oct 20 2018, 3:27 PM
CLOVIS added inline comments.
src/main/java/net/wildfyre/http/Request.kt
105

This contains the JSON parameters, if any. I'm tempted to just put json in there, but is that fine for the server?

114

As an example, to add an image (see doc here), what should I put?

Info-Screen added inline comments.Oct 22 2018, 9:47 AM
src/main/java/net/wildfyre/http/Request.kt
105

Normally you would put every json parameter into it's own block and have the name of the block be the name of the json part. To my knowledge there is no combined way to send form data + some json. You can always use the api with your webbrowser directly, and see what the browser sends (in the network console) for the different endpoints. The default in the browser is to use form data

114

when the user selects an image you should get the filename of the image. If you don't just put upload.<file_extension>

CLOVIS marked 4 inline comments as done.Oct 23 2018, 4:02 PM
CLOVIS added inline comments.
src/main/java/net/wildfyre/http/Request.kt
105

Exemple in the Telegram Bot API where you send both a picture and its caption, etc in one multipart request : https://core.telegram.org/bots/api#sendphoto

Info-Screen added inline comments.Oct 23 2018, 8:26 PM
src/main/java/net/wildfyre/http/Request.kt
105

Is the same here. But you can't (as far as I know) mix json and form-data

CLOVIS marked an inline comment as done.Oct 24 2018, 9:59 AM
CLOVIS updated this revision to Diff 702.Oct 25 2018, 2:01 PM
  • Added missing boundary & fixed missing filenames
CLOVIS marked 2 inline comments as done.Oct 25 2018, 2:03 PM
CLOVIS added inline comments.
src/main/java/net/wildfyre/http/Request.kt
105

Fixed, there were missing boundaries; I guess that's what you were talking about?

CLOVIS marked an inline comment as done.Oct 25 2018, 2:05 PM
WyldBot accepted this revision.Nov 9 2018, 6:14 PM
CLOVIS updated this revision to Diff 713.Sun, Dec 2, 12:04 PM
  • Better documentation in Request & better platform-types handling
  • Removed unneeded try-catch
CLOVIS planned changes to this revision.Wed, Dec 5, 7:02 PM

TODO: fix missing PATCH requests.

CLOVIS updated this revision to Diff 714.Wed, Dec 5, 8:32 PM
  • Method.java --> Kotlin
  • Logging, JSON field name, refactoring from Request.Companion
  • Clearing the users when reseting the Cache
  • Image to test the avatar & PATCH/multipart testing

Fix lint errors

CLOVIS planned changes to this revision.Sat, Dec 15, 1:32 PM

Need to fix multipart