Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/Snippets.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$pubnub->history()
->channel("my_channel")
->count(100)
->start(-1)
->start(1)
->end(13847168819178600)
->reverse(true)
->sync();
Expand Down
6 changes: 6 additions & 0 deletions src/PubNub/Endpoints/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ protected function sendRequest(RequestInterface $request): PNEnvelope
} else {
$response = $client->sendRequest($request);
}
// $this->pubnub->getLogger()->debug(sprintf(
// "%s response from %s negotiated HTTP/%s",
// $this->getName(),
// $request->getUri()->getHost(),
// $response->getProtocolVersion()
// ));
$envelope = $this->parseResponse($response);
} catch (NetworkExceptionInterface $exception) {
return new PNEnvelope(null, $this->createStatus(
Expand Down
10 changes: 9 additions & 1 deletion src/PubNub/Endpoints/FileSharing/SendFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,15 @@ protected function uploadFile()
$this->fileUploadEnvelope->getFormFields(),
$this->fileName,
$this->encryptPayload()
)
),
// File uploads can carry large bodies that exceed the standard
// non-subscribe request timeout. Pass the configured timeouts
// explicitly so they are tunable via PNConfiguration rather than
// falling back to the Requests library default (10s).
[
'timeout' => $this->getRequestTimeout(),
'connect_timeout' => $this->getConnectTimeout(),
]
);
return $response;
}
Expand Down
9 changes: 9 additions & 0 deletions tests/e2e/HereNowE2eTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ class HereNowE2eTest extends \PubNubTestCase
{
use PresenceTestHelper;

public function setUp(): void
{
parent::setUp();
$this->markTestSkipped(
'Implicit heartbeat has been disabled on the test keys, so these tests fail because the SDK has no '
. 'Heartbeat support and no explicit Heartbeat is executed.'
);
}

/**
* Test pagination with multiple channels - verifies limit applies per-channel
* This test requires real background clients to properly test the server-side pagination
Expand Down
11 changes: 10 additions & 1 deletion tests/integrational/FilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,15 @@ public function testFileUploadWithEmptyFile(): void

public function testFileUploadWithLargeFile(): void
{
// A 5MB upload (plus its download/verify) can exceed the default 10s
// non-subscribe request timeout. Use a dedicated PubNub with a longer
// timeout for this large-file transfer; SendFile now honors it. The
// shared config is locked after first use, so clone it (clone() returns
// an unlocked copy) rather than mutating it.
$config = $this->config->clone();
$config->setNonSubscribeRequestTimeout(60);
$pubnub = new PubNub($config);

// Create a large file (5MB)
$largeFilePath = __DIR__ . '/assets/large.txt';
$largeContent = str_repeat('x', 5 * 1024 * 1024); // 5MB of data
Expand All @@ -332,7 +341,7 @@ public function testFileUploadWithLargeFile(): void
try {
$file = fopen($largeFilePath, "r");

$response = $this->pubnub->sendFile()
$response = $pubnub->sendFile()
->channel($this->channel)
->fileHandle($file)
->fileName('large.txt')
Expand Down
2 changes: 1 addition & 1 deletion tests/integrational/PublishFileMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function tearDown(): void

public function testPublishFileMessageWithBasicMessage(): void
{
// First upload a file to get file ID
// First upload a File to get file ID
$file = fopen($this->testFilePath, "r");
$fileName = basename($this->testFilePath);

Expand Down
Loading