Skip to content

Error in progressCallback #679

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

Closed
mbfakourii opened this issue Oct 1, 2021 · 16 comments
Closed

Error in progressCallback #679

mbfakourii opened this issue Oct 1, 2021 · 16 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@mbfakourii
Copy link
Member

mbfakourii commented Oct 1, 2021

Error In Progress Callback

hi i can not use progressCallback its not It gives me no response

Code

initialize

await Parse().initialize(parseAppId, serverUrl,
        clientKey: parseClientKey,
        autoSendSessionId: true,
        debug: true,
        clientCreator: ({securityContext, required sendSessionId}) =>
            ParseDioClient(
                securityContext: ParseCoreData.instance.securityContext,
                sendSessionId: ParseCoreData.instance.autoSendSessionId),
        liveQueryUrl: serverUrl,
        coreStore: await CoreStoreSembastImp.getInstance());

and request

var news = ParseObject('Post');

news.set("content", content);
news.set('title', title);

ParseFileBase parseFile = file;

parseFile.upload(
    progressCallback: (int count, int total) {
      print("test output progress Callback");
    });

news.set("coverImage", parseFile);

await parseFile.save();

Parse Flutter SDK

  • SDK version: 3.1.0
  • Operating system: Android
  • Operating system version: 10

Database

  • System : MongoDB
@mbfakourii mbfakourii changed the title erro in progressCallback Error in progressCallback Oct 1, 2021
@RodrigoSMarques
Copy link
Contributor

parseFile.upload is a Future function.

You are missing an await in your code

@mbfakourii
Copy link
Member Author

parseFile.upload is a Future function.

You are missing an await in your code

Does not work with await either

var news = ParseObject('Post');

news.set("content", content);
news.set('title', title);

ParseFileBase parseFile = file;

await parseFile.upload(
    progressCallback: (int count, int total) {
      print("test output progress Callback");
    });

news.set("coverImage", parseFile);

await parseFile.save();

@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed Needs investigation labels Oct 7, 2021
@keanallen
Copy link

Hi, I have the same issue.

@RodrigoSMarques
Copy link
Contributor

I made the fix in my repository and it needs a test.
I will adjust the SDK and let you test it before updating the package in the package repository.

@RodrigoSMarques
Copy link
Contributor

The package is in the process of being updated and will be released in the next few days.

Please test and get back if it's ok.

In pubspec.yaml, make the changes below.

  #parse_server_sdk_flutter: ^3.1.0
  parse_server_sdk_flutter:
    git:
      url: https://github.com/RodrigoSMarques/Parse-SDK-Flutter.git
      ref: development
      path: packages/flutter

@keanallen
Copy link

keanallen commented Apr 25, 2022

It does not work on my end

This is what I got when I reload the app:
image

Code where i track the upload progress
image

What I've got (not printing the total and count) :
image

What I have tried so far:

  • flutter clean
  • flutter pub get

@mbfakourii
Copy link
Member Author

@keanallen remove await like this

parseFile.upload(
    progressCallback: (int count, int total) {
      print("test output progress Callback");
    });

@RodrigoSMarques
It works for me, but I also get this error
165048169-3ea98908-937e-4c91-87f1-1415b7fcb57b

@keanallen
Copy link

keanallen commented Apr 25, 2022

Still the same sir, my platform is desktop. It uploads successfully the file but not triggering the progressCallback, here's my code:

image
Removing await from parseFile.upload() doesn't work either

@keanallen
Copy link

Still the same sir, my platform is desktop. It uploads successfully the file but not triggering the progressCallback, here's my code:

image Removing await from parseFile.upload() doesn't work either

It works now!

I solved my issues by adding this settings in my Parse Initialization:

clientCreator: ({securityContext, required sendSessionId}) =>
          ParseDioClient(
              securityContext: ParseCoreData.instance.securityContext,
              sendSessionId: ParseCoreData.instance.autoSendSessionId),

@mtrezza mtrezza added type:question Support or code-level question and removed type:bug Impaired feature or lacking behavior that is likely assumed labels Apr 25, 2022
@mtrezza mtrezza closed this as completed Apr 25, 2022
@mbfakourii
Copy link
Member Author

@mtrezza this fix has bug !
Please see above
#679 (comment)

@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed and removed type:question Support or code-level question labels Apr 25, 2022
@mtrezza mtrezza reopened this Apr 25, 2022
@RodrigoSMarques
Copy link
Contributor

this is just a warning. I will try to remove it.
Depending on the size of the file the process is fast and will show only one line of progress.

to work it is necessary to be using the configuration with DIO client

@RodrigoSMarques
Copy link
Contributor

@keanallen remove await like this

parseFile.upload(
    progressCallback: (int count, int total) {
      print("test output progress Callback");
    });

@RodrigoSMarques It works for me, but I also get this error 165048169-3ea98908-937e-4c91-87f1-1415b7fcb57b

Just warning.

@mtrezza
Copy link
Member

mtrezza commented Apr 25, 2022

Is this warning something that is on us to fix in the Parse Flutter SDK?

@RodrigoSMarques
Copy link
Contributor

Is this warning something that is on us to fix in the Parse Flutter SDK?

Yes.

@RodrigoSMarques
Copy link
Contributor

Is this warning something that is on us to fix in the Parse Flutter SDK?

Yes.

Warning fix.

@RodrigoSMarques RodrigoSMarques mentioned this issue May 2, 2022
5 tasks
@Nidal-Bakir
Copy link
Member

not working for me!!
We need to wait until version 3.2.0 (#738) is released!!

@mtrezza mtrezza linked a pull request May 30, 2022 that will close this issue
5 tasks
RodrigoSMarques added a commit to RodrigoSMarques/Parse-SDK-Flutter that referenced this issue Jun 2, 2022
### Bug Fixes
* Old version of connectivity_plus package ([parse-community#717](parse-community#717))
* package_info_plus not work in web ([parse-community#714](parse-community#714))
* MissingPluginException (No implementation found for method getAll) ([parse-community#712](parse-community#712))
* Query fails for subclassed Parse object in Parse relation ([parse-community#697](parse-community#697))
* ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type ([parse-community#696](parse-community#696))
* Error in progressCallback ([parse-community#679](parse-community#679))
* first: Correct return type ([parse-community#661](parse-community#661))
* ParseLiveListWidget MongoError ([parse-community#653](parse-community#653))

* General improvements
* Updated dependencies
* Fix Label Platform Web Support in pub.dev - Refactor path_provider access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants