Skip to content

Revert "Fixed scroll behavior (#8977)" #9053

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

Merged
merged 6 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
9 changes: 9 additions & 0 deletions .changeset/dirty-crews-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@firebase/auth": patch
"@firebase/database": patch
"@firebase/firestore": patch
"@firebase/functions": patch
"@firebase/storage": patch
---

Revert "Fixed scroll behavior (#9043)"
3 changes: 0 additions & 3 deletions common/api-review/util.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,6 @@ export interface Subscribe<T> {
// @public (undocumented)
export type Unsubscribe = () => void;

// @public
export function updateEmulatorBanner(name: string, isRunningEmulator: boolean): void;

// Warning: (ae-missing-release-tag) "validateArgCount" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
Expand Down
16 changes: 6 additions & 10 deletions packages/auth/src/core/auth/emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ import { Auth } from '../../model/public_types';
import { AuthErrorCode } from '../errors';
import { _assert } from '../util/assert';
import { _castAuth } from './auth_impl';
import {
deepEqual,
isCloudWorkstation,
pingServer,
updateEmulatorBanner
} from '@firebase/util';
import { deepEqual, isCloudWorkstation, pingServer } from '@firebase/util';

/**
* Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production
Expand Down Expand Up @@ -102,12 +97,13 @@ export function connectAuthEmulator(
authInternal.emulatorConfig = emulatorConfig;
authInternal.settings.appVerificationDisabledForTesting = true;

if (!disableWarnings) {
emitEmulatorWarning();
}

// Workaround to get cookies in Firebase Studio
if (isCloudWorkstation(host)) {
updateEmulatorBanner('Auth', true);
// Workaround to get cookies in Firebase Studio
void pingServer(`${protocol}//${host}${portStr}`);
} else if (!disableWarnings) {
emitEmulatorWarning();
}
}

Expand Down
8 changes: 1 addition & 7 deletions packages/auth/src/platform_browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ import { browserSessionPersistence } from './persistence/session_storage';
import { indexedDBLocalPersistence } from './persistence/indexed_db';
import { browserPopupRedirectResolver } from './popup_redirect';
import { Auth, User } from '../model/public_types';
import {
getDefaultEmulatorHost,
getExperimentalSetting,
updateEmulatorBanner
} from '@firebase/util';
import { getDefaultEmulatorHost, getExperimentalSetting } from '@firebase/util';
import { _setExternalJSProvider } from './load_js';
import { _createError } from '../core/util/assert';
import { AuthErrorCode } from '../core/errors';
Expand Down Expand Up @@ -114,8 +110,6 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {
const authEmulatorHost = getDefaultEmulatorHost('auth');
if (authEmulatorHost) {
connectAuthEmulator(auth, `http://${authEmulatorHost}`);
} else {
updateEmulatorBanner('Auth', false);
}

return auth;
Expand Down
8 changes: 1 addition & 7 deletions packages/database/src/api/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ import {
EmulatorMockTokenOptions,
getDefaultEmulatorHostnameAndPort,
isCloudWorkstation,
pingServer,
updateEmulatorBanner
pingServer
} from '@firebase/util';

import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider';
Expand Down Expand Up @@ -258,10 +257,6 @@ export class Database implements _FirebaseService {
this.app.options['databaseAuthVariableOverride']
);
this._instanceStarted = true;
updateEmulatorBanner(
'Database',
this._repo.repoInfo_.emulatorOptions !== null
);
}
return this._repoInternal;
}
Expand Down Expand Up @@ -398,7 +393,6 @@ export function connectDatabaseEmulator(
// Workaround to get cookies in Firebase Studio
if (isCloudWorkstation(host)) {
void pingServer(host);
updateEmulatorBanner('Database', true);
}

// Modify the repo to apply emulator settings
Expand Down
11 changes: 3 additions & 8 deletions packages/firestore/src/lite-api/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
EmulatorMockTokenOptions,
getDefaultEmulatorHostnameAndPort,
isCloudWorkstation,
updateEmulatorBanner,
pingServer
} from '@firebase/util';

Expand Down Expand Up @@ -143,7 +142,6 @@ export class Firestore implements FirestoreService {

_freezeSettings(): FirestoreSettingsImpl {
this._settingsFrozen = true;
updateEmulatorBanner('Firestore', this._settings.isUsingEmulator);
return this._settings;
}

Expand Down Expand Up @@ -336,7 +334,9 @@ export function connectFirestoreEmulator(
emulatorOptions: firestore._getEmulatorOptions()
};
const newHostSetting = `${host}:${port}`;

if (useSsl) {
void pingServer(`https://${newHostSetting}`);
}
if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) {
logWarn(
'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' +
Expand All @@ -357,11 +357,6 @@ export function connectFirestoreEmulator(

firestore._setSettings(newConfig);

if (useSsl) {
void pingServer(`https://${newHostSetting}`);
updateEmulatorBanner('Firestore', true);
}

if (options.mockUserToken) {
let token: string;
let user: User;
Expand Down
4 changes: 1 addition & 3 deletions packages/functions/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ import {
} from './service';
import {
getModularInstance,
getDefaultEmulatorHostnameAndPort,
updateEmulatorBanner
getDefaultEmulatorHostnameAndPort
} from '@firebase/util';

export { FunctionsError } from './error';
Expand All @@ -48,7 +47,6 @@ export function getFunctions(
app: FirebaseApp = getApp(),
regionOrCustomDomain: string = DEFAULT_REGION
): Functions {
updateEmulatorBanner('Functions', false);
// Dependencies
const functionsProvider: Provider<'functions'> = _getProvider(
getModularInstance(app),
Expand Down
7 changes: 1 addition & 6 deletions packages/functions/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ import { Provider } from '@firebase/component';
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
import { MessagingInternalComponentName } from '@firebase/messaging-interop-types';
import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
import {
isCloudWorkstation,
pingServer,
updateEmulatorBanner
} from '@firebase/util';
import { isCloudWorkstation, pingServer } from '@firebase/util';

export const DEFAULT_REGION = 'us-central1';

Expand Down Expand Up @@ -186,7 +182,6 @@ export function connectFunctionsEmulator(
// Workaround to get cookies in Firebase Studio
if (useSsl) {
void pingServer(functionsInstance.emulatorOrigin);
updateEmulatorBanner('Functions', true);
}
}

Expand Down
4 changes: 1 addition & 3 deletions packages/storage/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ import { STORAGE_TYPE } from './constants';
import {
EmulatorMockTokenOptions,
getModularInstance,
getDefaultEmulatorHostnameAndPort,
updateEmulatorBanner
getDefaultEmulatorHostnameAndPort
} from '@firebase/util';
import { StringFormat } from './implementation/string';

Expand Down Expand Up @@ -333,7 +332,6 @@ export function getStorage(
bucketUrl?: string
): FirebaseStorage {
app = getModularInstance(app);
updateEmulatorBanner('Storage', false);
const storageProvider: Provider<'storage'> = _getProvider(app, STORAGE_TYPE);
const storageInstance = storageProvider.getImmediate({
identifier: bucketUrl
Expand Down
4 changes: 1 addition & 3 deletions packages/storage/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ import {
createMockUserToken,
EmulatorMockTokenOptions,
isCloudWorkstation,
pingServer,
updateEmulatorBanner
pingServer
} from '@firebase/util';
import { Connection, ConnectionType } from './implementation/connection';

Expand Down Expand Up @@ -151,7 +150,6 @@ export function connectStorageEmulator(
// Workaround to get cookies in Firebase Studio
if (useSsl) {
void pingServer(`https://${storage.host}`);
updateEmulatorBanner('Storage', true);
}
storage._isUsingEmulator = true;
storage._protocol = useSsl ? 'https' : 'http';
Expand Down
Loading